Skip to content

Commit

Permalink
fix: improve MFA QR Code resilience so as to support providers like 1…
Browse files Browse the repository at this point in the history
…Password (#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
  • Loading branch information
J0 authored Feb 26, 2024
1 parent f29e89d commit 6522780
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/api/mfa.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6522780

Please sign in to comment.