feat: integrate support for multi step auth flows for providers that require additional questions (#18035)

This commit is contained in:
Aiden Cline
2026-03-18 11:36:19 -05:00
committed by GitHub
parent 822bb7b336
commit 171e69c2fc
11 changed files with 344 additions and 8 deletions

View File

@@ -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<