fix anthropic console auth (#2049)

This commit is contained in:
Dax 2025-08-18 17:12:21 -04:00 • committed by GitHub
commit f19586cebd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 121 additions and 24 deletions

View file

@ -176,12 +176,20 @@ export const AuthLoginCommand = cmd({
spinner.stop("Failed to authorize", 1)
}
if (result.type === "success") {
await Auth.set(provider, {
type: "oauth",
refresh: result.refresh,
access: result.access,
expires: result.expires,
})
if ("refresh" in result) {
await Auth.set(provider, {
type: "oauth",
refresh: result.refresh,
access: result.access,
expires: result.expires,
})
}
if ("key" in result) {
await Auth.set(provider, {
type: "api",
key: result.key,
})
}
spinner.stop("Login successful")
}
}
@ -197,12 +205,20 @@ export const AuthLoginCommand = cmd({
prompts.log.error("Failed to authorize")
}
if (result.type === "success") {
await Auth.set(provider, {
type: "oauth",
refresh: result.refresh,
access: result.access,
expires: result.expires,
})
if ("refresh" in result) {
await Auth.set(provider, {
type: "oauth",
refresh: result.refresh,
access: result.access,
expires: result.expires,
})
}
if ("key" in result) {
await Auth.set(provider, {
type: "api",
key: result.key,
})
}
prompts.log.success("Login successful")
}
}