From ff79db0a992cf8af4f110481d8b2fc1adee0741d Mon Sep 17 00:00:00 2001 From: Randy Torres Date: Tue, 6 Jan 2026 22:19:11 -0600 Subject: [PATCH] fix(auth): use anthropic oauth email profile Use Anthropic OAuth profile email as the profile identifier when available. This fixes cases where Anthropic returns an email-based profile id rather than an explicit id field. --- src/commands/configure.ts | 3 ++- src/wizard/onboarding.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/commands/configure.ts b/src/commands/configure.ts index 95905171b..233442497 100644 --- a/src/commands/configure.ts +++ b/src/commands/configure.ts @@ -299,8 +299,9 @@ async function promptAuthConfig( spin.stop("OAuth complete"); if (oauthCreds) { await writeOAuthCredentials("anthropic", oauthCreds); + const profileId = `anthropic:${oauthCreds.email ?? "default"}`; next = applyAuthProfileConfig(next, { - profileId: "anthropic:default", + profileId, provider: "anthropic", mode: "oauth", }); diff --git a/src/wizard/onboarding.ts b/src/wizard/onboarding.ts index 6b8842a8a..9aebc8085 100644 --- a/src/wizard/onboarding.ts +++ b/src/wizard/onboarding.ts @@ -295,8 +295,9 @@ export async function runOnboardingWizard( spin.stop("OAuth complete"); if (oauthCreds) { await writeOAuthCredentials("anthropic", oauthCreds); + const profileId = `anthropic:${oauthCreds.email ?? "default"}`; nextConfig = applyAuthProfileConfig(nextConfig, { - profileId: "anthropic:default", + profileId, provider: "anthropic", mode: "oauth", });