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.
This commit is contained in:
Randy Torres
2026-01-06 22:19:11 -06:00
committed by Peter Steinberger
parent 8b1263ce11
commit ff79db0a99
2 changed files with 4 additions and 2 deletions

View File

@@ -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",
});

View File

@@ -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",
});