MCPcopy
hub / github.com/codeaashu/claude-code / isUsingOAuth

Function isUsingOAuth

src/services/settingsSync/index.ts:212–221  ·  view source on GitHub ↗

* Check if user is authenticated with first-party OAuth. * Required for settings sync in both CLI (upload) and CCR (download) modes. * * Only checks user:inference (not user:profile) — CCR's file-descriptor token * hardcodes scopes to ['user:inference'] only, so requiring profile would make * d

()

Source from the content-addressed store, hash-verified

210 * download a no-op there. Upload is independently guarded by getIsInteractive().
211 */
212function isUsingOAuth(): boolean {
213 if (getAPIProvider() !== 'firstParty' || !isFirstPartyAnthropicBaseUrl()) {
214 return false
215 }
216
217 const tokens = getClaudeAIOAuthTokens()
218 return Boolean(
219 tokens?.accessToken && tokens.scopes?.includes(CLAUDE_AI_INFERENCE_SCOPE),
220 )
221}
222
223function getSettingsSyncEndpoint(): string {
224 return `${getOauthConfig().BASE_API_URL}/api/claude_code/user_settings`

Callers 2

doDownloadUserSettingsFunction · 0.70

Calls 2

getAPIProviderFunction · 0.85

Tested by

no test coverage detected