From 652278046c9dd92f5cecd778735b058ef3fb41c7 Mon Sep 17 00:00:00 2001 From: Joel Lee Date: Mon, 26 Feb 2024 16:37:26 +0530 Subject: [PATCH] fix: improve MFA QR Code resilience so as to support providers like 1Password (#1455) ## What kind of change does this PR introduce? Reduced version of #1438. This increases the [error correction level](https://pkg.go.dev/github.com/boombuler/barcode@v1.0.1/qr#ErrorCorrectionLevel) which should make the QR Code easier to scan Other aspects such as visibility of QR code and potentially size adjustments will be handled for later. Want to get the minimal possible change out that might fix the issue Works with 1Password locally, will test against Supabase setup once merged --- internal/api/mfa.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/mfa.go b/internal/api/mfa.go index 94c422f0a..b67610d1d 100644 --- a/internal/api/mfa.go +++ b/internal/api/mfa.go @@ -124,7 +124,7 @@ func (a *API) EnrollFactor(w http.ResponseWriter, r *http.Request) error { } var buf bytes.Buffer svgData := svg.New(&buf) - qrCode, _ := qr.Encode(key.String(), qr.M, qr.Auto) + qrCode, _ := qr.Encode(key.String(), qr.H, qr.Auto) qs := goqrsvg.NewQrSVG(qrCode, DefaultQRSize) qs.StartQrSVG(svgData) if err = qs.WriteQrSVG(svgData); err != nil {