Fix TOTP QR render
Update TotpEnrollmentWizard to handle QR code data_uri gracefully by using enrollmentData.qr_code directly if it already starts with data:, otherwise prefix with data:image/png;base64,. This prevents invalid HTML and extra requests. X-Lovable-Edit-ID: edt-779080b3-442d-4aeb-aaaf-e0e3c26b795d
This commit is contained in:
@@ -205,7 +205,7 @@ export function TotpEnrollmentWizard({
|
||||
<>
|
||||
<div className="flex justify-center p-4 bg-white rounded-lg">
|
||||
<img
|
||||
src={`data:image/png;base64,${enrollmentData.qr_code}`}
|
||||
src={enrollmentData.qr_code.startsWith('data:') ? enrollmentData.qr_code : `data:image/png;base64,${enrollmentData.qr_code}`}
|
||||
alt="TOTP QR Code"
|
||||
className="w-48 h-48"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user