mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-08-05 06:50:10 +00:00
The TOTP QR reader relied solely on window.BarcodeDetector. On desktop Chrome/Edge (Windows/Linux) that interface exists but has no working backend, so detect() returns an empty array: uploading a valid QR image fell through to "no QR code found" and the camera path bailed to "unsupported" with an empty preview. Add a dependency-free jsQR canvas fallback. decodeTotpQrImage now tries BarcodeDetector first when present, then decodes the image via jsQR before reporting not-found. The camera reader no longer hard-returns "unsupported" when only BarcodeDetector is missing: it starts the camera whenever getUserMedia is available and decodes frames with jsQR, which also lets the preview render. Fixes #276