OAuth: normalize profile email

This commit is contained in:
Mario Zechner
2026-01-31 05:26:18 +01:00
parent 9b1a6b30d9
commit ca47b0d79c
2 changed files with 4 additions and 5 deletions

View File

@@ -68,10 +68,8 @@ export async function applyAuthChoiceOAuth(
});
spin.stop("Chutes OAuth complete");
const email =
(typeof creds.email === "string" ? creds.email.trim() : String(creds.email ?? "").trim()) ||
"default";
const profileId = `chutes:${email}`;
const email = typeof creds.email === "string" ? creds.email.trim() : "";
const profileId = `chutes:${email || "default"}`;
await writeOAuthCredentials("chutes", creds, params.agentDir);
nextConfig = applyAuthProfileConfig(nextConfig, {

View File

@@ -10,8 +10,9 @@ export async function writeOAuthCredentials(
agentDir?: string,
): Promise<void> {
// Write to resolved agent dir so gateway finds credentials on startup.
const email = typeof creds.email === "string" ? creds.email.trim() : "";
upsertAuthProfile({
profileId: `${provider}:${creds.email ?? "default"}`,
profileId: `${provider}:${email || "default"}`,
credential: {
type: "oauth",
provider,