Skip to content

Commit ca47b0d

Browse files
committed
OAuth: normalize profile email
1 parent 9b1a6b3 commit ca47b0d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/commands/auth-choice.apply.oauth.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,8 @@ export async function applyAuthChoiceOAuth(
6868
});
6969

7070
spin.stop("Chutes OAuth complete");
71-
const email =
72-
(typeof creds.email === "string" ? creds.email.trim() : String(creds.email ?? "").trim()) ||
73-
"default";
74-
const profileId = `chutes:${email}`;
71+
const email = typeof creds.email === "string" ? creds.email.trim() : "";
72+
const profileId = `chutes:${email || "default"}`;
7573

7674
await writeOAuthCredentials("chutes", creds, params.agentDir);
7775
nextConfig = applyAuthProfileConfig(nextConfig, {

src/commands/onboard-auth.credentials.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ export async function writeOAuthCredentials(
1010
agentDir?: string,
1111
): Promise<void> {
1212
// Write to resolved agent dir so gateway finds credentials on startup.
13+
const email = typeof creds.email === "string" ? creds.email.trim() : "";
1314
upsertAuthProfile({
14-
profileId: `${provider}:${creds.email ?? "default"}`,
15+
profileId: `${provider}:${email || "default"}`,
1516
credential: {
1617
type: "oauth",
1718
provider,

0 commit comments

Comments
 (0)