fix(auth): prevent API key reuse across login prompts

This commit is contained in:
Federico Jaramillo Martinez
2026-07-17 23:18:58 +02:00
parent 71ca256015
commit a39cf49f3a
4 changed files with 180 additions and 16 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ import type { AuthProviderOption, AuthProviderStatus, AuthType } from "../../sha
interface AuthProviderInfo {
id: string;
name: string;
auth: { apiKey?: unknown; oauth?: unknown };
auth: { apiKey?: { login?: unknown }; oauth?: unknown };
}
/** Non-secret stored-credential metadata, keyed by provider id. */
@@ -40,7 +40,7 @@ export function getLoginProviderOptions(runtime: AuthProviderRuntime, authType?:
}
for (const provider of providers) {
if (provider.auth.apiKey === undefined) continue;
if (provider.auth.apiKey?.login === undefined) continue;
options.push({
id: provider.id,
name: provider.name,