fix: enhance QR code visibility with background and border adjustments

This commit is contained in:
shuaiplus
2026-04-01 23:05:44 +08:00
parent be82c953d6
commit f4adeb8ec9
2 changed files with 9 additions and 2 deletions
+2 -1
View File
@@ -73,7 +73,8 @@ export default function SettingsPage(props: SettingsPageProps) {
const qr = qrcode(0, 'M');
qr.addData(buildOtpUri(props.profile.email, secret));
qr.make();
const svg = qr.createSvgTag({ scalable: true, margin: 0 });
// Keep a visible quiet zone so authenticator apps can scan reliably in both themes.
const svg = qr.createSvgTag({ scalable: true, margin: 4 });
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
}, [props.profile.email, secret]);