MCPcopy
hub / github.com/claude-code-best/claude-code / isManagedOAuthContext

Function isManagedOAuthContext

src/utils/auth.ts:91–96  ·  view source on GitHub ↗

* CCR and Claude Desktop spawn the CLI with OAuth and should never fall back * to the user's ~/.claude/settings.json API-key config (apiKeyHelper, * env.ANTHROPIC_API_KEY, env.ANTHROPIC_AUTH_TOKEN). Those settings exist for * the user's terminal CLI, not managed sessions. Without this guard, a us

()

Source from the content-addressed store, hash-verified

89 * also use that key — and fail if it's stale/wrong-org.
90 */
91function isManagedOAuthContext(): boolean {
92 return (
93 isEnvTruthy(process.env.CLAUDE_CODE_REMOTE) ||
94 process.env.CLAUDE_CODE_ENTRYPOINT === 'claude-desktop'
95 )
96}
97
98/** Whether we are supporting direct 1P auth. */
99// this code is closely related to getAuthTokenSource

Callers 2

isAnthropicAuthEnabledFunction · 0.85
getAuthTokenSourceFunction · 0.85

Calls 1

isEnvTruthyFunction · 0.70

Tested by

no test coverage detected