Skip to content

Commit 7765808

Browse files
AsteriskLakemichaeledi
authored andcommitted
fix(auth): detect Anthropic auth token from environment
1 parent 31f28a2 commit 7765808

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

server/routes/cli-auth.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ async function loadClaudeSettingsEnv() {
115115
/**
116116
* Checks Claude authentication credentials using two methods with priority order:
117117
*
118-
* Priority 1: ANTHROPIC_API_KEY environment variable
118+
* Priority 1: ANTHROPIC_API_KEY / ANTHROPIC_AUTH_TOKEN environment variables
119119
* Priority 1b: ~/.claude/settings.json env values
120120
* Priority 2: ~/.claude/.credentials.json OAuth tokens
121121
*
@@ -145,6 +145,14 @@ async function checkClaudeCredentials() {
145145
};
146146
}
147147

148+
if (process.env.ANTHROPIC_AUTH_TOKEN && process.env.ANTHROPIC_AUTH_TOKEN.trim()) {
149+
return {
150+
authenticated: true,
151+
email: 'Configured via environment',
152+
method: 'api_key'
153+
};
154+
}
155+
148156
// Priority 1b: Check ~/.claude/settings.json env values.
149157
// Claude Code can read proxy/auth values from settings.json even when the
150158
// CloudCLI server process itself was not started with those env vars exported.

0 commit comments

Comments
 (0)