mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-28 13:14:28 +01:00
fix anthropic console auth (#2049)
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
0
packages/opencode/src/cli/cmd/opentui/opentui.ts
Normal file
0
packages/opencode/src/cli/cmd/opentui/opentui.ts
Normal file
@@ -26,7 +26,7 @@ export namespace Plugin {
|
||||
const plugins = [...(config.plugin ?? [])]
|
||||
if (!Flag.OPENCODE_DISABLE_DEFAULT_PLUGINS) {
|
||||
plugins.push("opencode-copilot-auth")
|
||||
plugins.push("opencode-anthropic-auth")
|
||||
plugins.push("opencode-anthropic-auth@0.0.2")
|
||||
}
|
||||
for (let plugin of plugins) {
|
||||
log.info("loading plugin", { path: plugin })
|
||||
|
||||
Reference in New Issue
Block a user