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:
parent
86fde78442
commit
068ec5fa0a
@ -299,8 +299,9 @@ async function promptAuthConfig(
|
|||||||
spin.stop("OAuth complete");
|
spin.stop("OAuth complete");
|
||||||
if (oauthCreds) {
|
if (oauthCreds) {
|
||||||
await writeOAuthCredentials("anthropic", oauthCreds);
|
await writeOAuthCredentials("anthropic", oauthCreds);
|
||||||
|
const profileId = `anthropic:${oauthCreds.email ?? "default"}`;
|
||||||
next = applyAuthProfileConfig(next, {
|
next = applyAuthProfileConfig(next, {
|
||||||
profileId: "anthropic:default",
|
profileId,
|
||||||
provider: "anthropic",
|
provider: "anthropic",
|
||||||
mode: "oauth",
|
mode: "oauth",
|
||||||
});
|
});
|
||||||
|
|||||||
@ -295,8 +295,9 @@ export async function runOnboardingWizard(
|
|||||||
spin.stop("OAuth complete");
|
spin.stop("OAuth complete");
|
||||||
if (oauthCreds) {
|
if (oauthCreds) {
|
||||||
await writeOAuthCredentials("anthropic", oauthCreds);
|
await writeOAuthCredentials("anthropic", oauthCreds);
|
||||||
|
const profileId = `anthropic:${oauthCreds.email ?? "default"}`;
|
||||||
nextConfig = applyAuthProfileConfig(nextConfig, {
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
||||||
profileId: "anthropic:default",
|
profileId,
|
||||||
provider: "anthropic",
|
provider: "anthropic",
|
||||||
mode: "oauth",
|
mode: "oauth",
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user