feat(oauth): support interactive login selection (#4190)

This commit is contained in:
Armin Ronacher
2026-05-05 13:16:56 +02:00
committed by GitHub
parent bb25a3944c
commit b5755fd27d
4 changed files with 47 additions and 1 deletions

View File

@@ -23,11 +23,23 @@ export type OAuthAuthInfo = {
instructions?: string;
};
export type OAuthSelectOption = {
id: string;
label: string;
};
export type OAuthSelectPrompt = {
message: string;
options: OAuthSelectOption[];
};
export interface OAuthLoginCallbacks {
onAuth: (info: OAuthAuthInfo) => void;
onPrompt: (prompt: OAuthPrompt) => Promise<string>;
onProgress?: (message: string) => void;
onManualCodeInput?: () => Promise<string>;
/** Show an interactive selector and return the selected option id, or undefined on cancel. */
onSelect?: (prompt: OAuthSelectPrompt) => Promise<string | undefined>;
signal?: AbortSignal;
}