fix(qr): dire "ce QR n'est pas un code 2FA" au lieu de "aucun QR"
Un QR de texte, ou un QR dynamique qui encode un lien de suivi, etait lu puis ecarte en silence : l'exe repondait "aucun QR 2FA trouve", l'APK continuait de viser sans rien dire. Le texte d'un autre QR ne part toujours pas a la page ; seul le fait qu'un QR a ete lu est signale. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4839,9 +4839,13 @@ function soTotpField(plainSecret) {
|
||||
const scan = el('button', { class: 'icon-btn icon-btn-sm', type: 'button', title: 'Scan the 2FA QR code shown on screen' });
|
||||
scan.appendChild(icon('i-qr'));
|
||||
scan.addEventListener('click', () => {
|
||||
Bridge.onScreenQr = (text) => {
|
||||
Bridge.onScreenQr = (text, found) => {
|
||||
const secret = parseOtpAuthUri(text || '');
|
||||
if (!secret) { toast('No 2FA QR code found on screen', 'warning'); return; }
|
||||
if (!secret) {
|
||||
toast(found ? 'This QR code is not a 2FA code (it has no otpauth:// link)'
|
||||
: 'No QR code found on screen', 'warning');
|
||||
return;
|
||||
}
|
||||
input.value = secret;
|
||||
updateTotpDisplay();
|
||||
soDirtyCheck();
|
||||
|
||||
Reference in New Issue
Block a user