fix(claude): use api.anthropic.com for OAuth token exchange

console.anthropic.com is now protected by a Cloudflare managed challenge
that blocks all non-browser POST requests to /v1/oauth/token, causing
`-claude-login` to fail with a 403 error.

Switch to api.anthropic.com which hosts the same OAuth token endpoint
without the Cloudflare managed challenge.

Fixes #1659

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Grivn
2026-02-20 20:11:27 +08:00
parent 4445a165e9
commit ef5901c81b

View File

@@ -20,7 +20,7 @@ import (
// OAuth configuration constants for Claude/Anthropic // OAuth configuration constants for Claude/Anthropic
const ( const (
AuthURL = "https://claude.ai/oauth/authorize" AuthURL = "https://claude.ai/oauth/authorize"
TokenURL = "https://console.anthropic.com/v1/oauth/token" TokenURL = "https://api.anthropic.com/v1/oauth/token"
ClientID = "9d1c250a-e61b-44d9-88ed-5944d1962f5e" ClientID = "9d1c250a-e61b-44d9-88ed-5944d1962f5e"
RedirectURI = "http://localhost:54545/callback" RedirectURI = "http://localhost:54545/callback"
) )