Update portal dependencies for security advisories

This commit is contained in:
Leon Tonhäuser committed 2026-11-30 19:30:30 +01:00
1 parent 69264ce165
commit f899417b1e
6 files changed
+703 -743

No files matched your search

+9 -4
View File
@@ -24,14 +24,19 @@ export function TwoFactorWizard({ initiallyEnabled }: { initiallyEnabled: boolea
const password = readPassword(event.currentTarget);
try {
const result = await authClient.twoFactor.enable({ password });
const result = await authClient.twoFactor.enable({ password, method: "totp" });
if (result.error) {
setError(twoFactorErrorMessage(result.error.code));
return;
}
const uri = result.data?.totpURI;
setSecret(uri ? new URL(uri).searchParams.get("secret") ?? undefined : undefined);
setBackupCodes(result.data?.backupCodes ?? []);
if (result.data?.method !== "totp") {
setError("Das Einrichten ist fehlgeschlagen. Bitte versuchen Sie es erneut.");
return;
}
const setupSecret = new URL(result.data.totpURI).searchParams.get("secret");
if (!setupSecret) throw new Error("Missing TOTP secret");
setSecret(setupSecret);
setBackupCodes(result.data.backupCodes);
setStep("scan");
} catch {
setError("Das Einrichten ist fehlgeschlagen. Bitte versuchen Sie es erneut.");