From 171e69c2fc148985af7b9506b47f048d3a34a767 Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Wed, 18 Mar 2026 11:36:19 -0500 Subject: feat: integrate support for multi step auth flows for providers that require additional questions (#18035) --- packages/plugin/src/index.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'packages/plugin') 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 +type Rule = { + key: string + op: "eq" | "neq" + value: string +} + export type AuthHook = { provider: string loader?: (auth: () => Promise, provider: Provider) => Promise> @@ -48,7 +54,9 @@ export type AuthHook = { message: string placeholder?: string validate?: (value: string) => string | undefined + /** @deprecated Use `when` instead */ condition?: (inputs: Record) => boolean + when?: Rule } | { type: "select" @@ -59,7 +67,9 @@ export type AuthHook = { value: string hint?: string }> + /** @deprecated Use `when` instead */ condition?: (inputs: Record) => boolean + when?: Rule } > authorize(inputs?: Record): Promise @@ -74,7 +84,9 @@ export type AuthHook = { message: string placeholder?: string validate?: (value: string) => string | undefined + /** @deprecated Use `when` instead */ condition?: (inputs: Record) => boolean + when?: Rule } | { type: "select" @@ -85,7 +97,9 @@ export type AuthHook = { value: string hint?: string }> + /** @deprecated Use `when` instead */ condition?: (inputs: Record) => boolean + when?: Rule } > authorize?(inputs?: Record): Promise< -- cgit v1.2.3