Add OTP fallback auth and progress handoff log

This commit is contained in:
Ivan Pereira
2026-02-16 18:51:09 +00:00
parent 86b0c37a08
commit 39b8ee6b57
3 changed files with 428 additions and 26 deletions
+13 -1
View File
@@ -34,7 +34,19 @@ export default function (pi: ExtensionAPI) {
details: { toolCallId },
});
const jwt = await authenticate();
const promptInput = async (label: string, placeholder: string): Promise<string | null | undefined> => {
if (!ctx?.ui?.input) {
return undefined;
}
return ctx.ui.input(label, placeholder);
};
const jwt = await authenticate({
signal,
promptForEmail: async () => promptInput("Perplexity email", "you@example.com"),
promptForOtp: async (email) => promptInput(`Enter OTP sent to ${email}`, "123456"),
});
if (signal?.aborted) {
return {