fix(mfa): generate SVG QR code

Replace the rasterized 180px PNG QR code with a crisp 250px SVG
This commit is contained in:
jubnl
2026-04-05 17:14:36 +02:00
parent 9ee5d21c3a
commit c6148ba4f2
4 changed files with 7 additions and 7 deletions

View File

@@ -816,7 +816,7 @@ export function setupMfa(userId: number, userEmail: string): { error?: string; s
console.error('[MFA] Setup error:', err);
return { error: 'MFA setup failed', status: 500 };
}
return { secret, otpauth_url, qrPromise: QRCode.toDataURL(otpauth_url) };
return { secret, otpauth_url, qrPromise: QRCode.toString(otpauth_url, { type: 'svg', width: 250 }) };
}
export function enableMfa(userId: number, code?: string): { error?: string; status?: number; success?: boolean; mfa_enabled?: boolean; backup_codes?: string[] } {