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:
committed by
Peter Steinberger
parent
8b1263ce11
commit
ff79db0a99
@@ -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",
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user