diff options
| author | Goni Zahavy <[email protected]> | 2026-04-14 20:53:00 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-04-14 12:53:00 -0500 |
| commit | 9a5178e4ac0c3fabe4ab07f8f8784f496906748e (patch) | |
| tree | 2b15dce9ab320f4f775ee8109d25d7a991d10b1e /packages | |
| parent | 68384613be9b3869760064521ad5d0f3ba30062a (diff) | |
| download | opencode-9a5178e4ac0c3fabe4ab07f8f8784f496906748e.tar.gz opencode-9a5178e4ac0c3fabe4ab07f8f8784f496906748e.zip | |
fix(cli): handlePluginAuth asks for api key only if authorize method exists (#22475)
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/opencode/src/cli/cmd/providers.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/opencode/src/cli/cmd/providers.ts b/packages/opencode/src/cli/cmd/providers.ts index 5d5cd1ff8..d2afbabfb 100644 --- a/packages/opencode/src/cli/cmd/providers.ts +++ b/packages/opencode/src/cli/cmd/providers.ts @@ -158,13 +158,13 @@ async function handlePluginAuth(plugin: { auth: PluginAuth }, provider: string, } if (method.type === "api") { - const key = await prompts.password({ - message: "Enter your API key", - validate: (x) => (x && x.length > 0 ? undefined : "Required"), - }) - if (prompts.isCancel(key)) throw new UI.CancelledError() - if (method.authorize) { + const key = await prompts.password({ + message: "Enter your API key", + validate: (x) => (x && x.length > 0 ? undefined : "Required"), + }) + if (prompts.isCancel(key)) throw new UI.CancelledError() + const result = await method.authorize(inputs) if (result.type === "failed") { prompts.log.error("Failed to authorize") |
