11 lines
406 B
JavaScript
11 lines
406 B
JavaScript
/* 2FA activation: draws the otpauth:// QR code locally (no external service). */
|
|
(function () {
|
|
'use strict';
|
|
var box = document.querySelector('[data-otpauth]');
|
|
if (!box || typeof window.qrcode !== 'function') return;
|
|
var qr = window.qrcode(0, 'M');
|
|
qr.addData(box.getAttribute('data-otpauth'));
|
|
qr.make();
|
|
box.innerHTML = qr.createSvgTag({ cellSize: 5, margin: 4, scalable: true });
|
|
})();
|