From 06df6a955a1daa2f78767239a39709cda83a898a Mon Sep 17 00:00:00 2001 From: Muhammed Mukhthar CM Date: Tue, 6 Jan 2026 04:37:15 +0000 Subject: [PATCH] feat: use email-based profile IDs for OAuth providers Changes writeOAuthCredentials and applyAuthProfileConfig calls to use the email from OAuth response as part of the profile ID instead of hardcoded ":default". This enables multiple accounts per provider - each login creates a separate profile (e.g., google-antigravity:user@gmail.com) instead of overwriting the same :default profile. Affected files: - src/commands/onboard-auth.ts (generic writeOAuthCredentials) - src/commands/configure.ts (Antigravity flow) - src/wizard/onboarding.ts (Antigravity flow) --- src/commands/configure.ts | 2 +- src/commands/onboard-auth.ts | 2 +- src/wizard/onboarding.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/configure.ts b/src/commands/configure.ts index e2b8b6451..d65908f5a 100644 --- a/src/commands/configure.ts +++ b/src/commands/configure.ts @@ -323,7 +323,7 @@ async function promptAuthConfig( if (oauthCreds) { await writeOAuthCredentials("google-antigravity", oauthCreds); next = applyAuthProfileConfig(next, { - profileId: "google-antigravity:default", + profileId: `google-antigravity:${oauthCreds.email ?? "default"}`, provider: "google-antigravity", mode: "oauth", }); diff --git a/src/commands/onboard-auth.ts b/src/commands/onboard-auth.ts index 3da496b34..8151bfca3 100644 --- a/src/commands/onboard-auth.ts +++ b/src/commands/onboard-auth.ts @@ -7,7 +7,7 @@ export async function writeOAuthCredentials( creds: OAuthCredentials, ): Promise { upsertAuthProfile({ - profileId: `${provider}:default`, + profileId: `${provider}:${creds.email ?? "default"}`, credential: { type: "oauth", provider, diff --git a/src/wizard/onboarding.ts b/src/wizard/onboarding.ts index 724dfec01..3ce8a0193 100644 --- a/src/wizard/onboarding.ts +++ b/src/wizard/onboarding.ts @@ -462,7 +462,7 @@ export async function runOnboardingWizard( if (oauthCreds) { await writeOAuthCredentials("google-antigravity", oauthCreds); nextConfig = applyAuthProfileConfig(nextConfig, { - profileId: "google-antigravity:default", + profileId: `google-antigravity:${oauthCreds.email ?? "default"}`, provider: "google-antigravity", mode: "oauth", });