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 (supabase#1455)

## What kind of change does this PR introduce?

Reduced version of supabase#1438. This increases the [error correction
level](https://pkg.go.dev/github.com/boombuler/[email protected]/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 f8610d4 commit 61e8983
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 61e8983

Please sign in to comment.