summaryrefslogtreecommitdiffhomepage
path: root/packages/plugin
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2026-03-18 11:36:19 -0500
committerGitHub <[email protected]>2026-03-18 11:36:19 -0500
commit171e69c2fc148985af7b9506b47f048d3a34a767 (patch)
tree0f99fed774361a768c15a79825fd4c30b55bea2c /packages/plugin
parent822bb7b3366d051a6d74657b7764f7f403a0c9a8 (diff)
downloadopencode-171e69c2fc148985af7b9506b47f048d3a34a767.tar.gz
opencode-171e69c2fc148985af7b9506b47f048d3a34a767.zip
feat: integrate support for multi step auth flows for providers that require additional questions (#18035)
Diffstat (limited to 'packages/plugin')
-rw-r--r--packages/plugin/src/index.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/plugin/src/index.ts b/packages/plugin/src/index.ts
index b78bcae17..7e5ae7a6e 100644
--- a/packages/plugin/src/index.ts
+++ b/packages/plugin/src/index.ts
@@ -34,6 +34,12 @@ export type PluginInput = {
export type Plugin = (input: PluginInput) => Promise<Hooks>
+type Rule = {
+ key: string
+ op: "eq" | "neq"
+ value: string
+}
+
export type AuthHook = {
provider: string
loader?: (auth: () => Promise<Auth>, provider: Provider) => Promise<Record<string, any>>
@@ -48,7 +54,9 @@ export type AuthHook = {
message: string
placeholder?: string
validate?: (value: string) => string | undefined
+ /** @deprecated Use `when` instead */
condition?: (inputs: Record<string, string>) => boolean
+ when?: Rule
}
| {
type: "select"
@@ -59,7 +67,9 @@ export type AuthHook = {
value: string
hint?: string
}>
+ /** @deprecated Use `when` instead */
condition?: (inputs: Record<string, string>) => boolean
+ when?: Rule
}
>
authorize(inputs?: Record<string, string>): Promise<AuthOuathResult>
@@ -74,7 +84,9 @@ export type AuthHook = {
message: string
placeholder?: string
validate?: (value: string) => string | undefined
+ /** @deprecated Use `when` instead */
condition?: (inputs: Record<string, string>) => boolean
+ when?: Rule
}
| {
type: "select"
@@ -85,7 +97,9 @@ export type AuthHook = {
value: string
hint?: string
}>
+ /** @deprecated Use `when` instead */
condition?: (inputs: Record<string, string>) => boolean
+ when?: Rule
}
>
authorize?(inputs?: Record<string, string>): Promise<