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

@@ -46,9 +46,13 @@ async function handlePluginAuth(plugin: { auth: PluginAuth }, provider: string,
const inputs: Record<string, string> = {}
if (method.prompts) {
for (const prompt of method.prompts) {
if (prompt.condition && !prompt.condition(inputs)) {
continue
if (prompt.when) {
const value = inputs[prompt.when.key]
if (value === undefined) continue
const matches = prompt.when.op === "eq" ? value === prompt.when.value : value !== prompt.when.value
if (!matches) continue
}
if (prompt.condition && !prompt.condition(inputs)) continue
if (prompt.type === "select") {
const value = await prompts.select({
message: prompt.message,