Skip to content

Fix QR code alignment pattern placement for 2FA setup#68

Merged
chenyme merged 2 commits into
DEEIX-AI:devfrom
yuancjun:patch-1
May 29, 2026
Merged

Fix QR code alignment pattern placement for 2FA setup#68
chenyme merged 2 commits into
DEEIX-AI:devfrom
yuancjun:patch-1

Conversation

@yuancjun

Copy link
Copy Markdown
Contributor

Summary

Fixes the custom QR code generator so it correctly places alignment patterns that overlap timing rows or columns.

Why

During 2FA setup, valid otpauth:// data from the backend could produce an unreadable QR code on the frontend. The QR generator skipped any alignment pattern whose center was already marked as reserved. For Version 7 QR codes, this incorrectly skipped valid alignment patterns at (22, 6) and (6, 22) because they overlap the timing row/column.

What Changed

  • Only skip alignment patterns that would overlap the three finder patterns.
  • Allow alignment patterns to be drawn when they overlap timing rows or columns.

Verification

  • Regenerated the same 2FA QR payload and confirmed all Version 7 alignment patterns are present.
  • Ran ESLint for shared/lib/qr-code.ts.

@chenyme
chenyme merged commit cac0c7c into DEEIX-AI:dev May 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants