Repository navigation
[WEB-10169] fix: use eight-digit magic sign-in codes - #10301
Conversation
Six digits left too small a code space for the per-code and per-window attempt caps. The code stays numeric and is still generated with secrets; the sign-in forms do not validate its length, so only the example placeholders change.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
sriramveeraghanta
left a comment
There was a problem hiding this comment.
LGTM. Codes compare as strings, so 6-digit codes already in flight during a rolling deploy still validate. Worth confirming that no client outside this repo (e.g. mobile) has a fixed 6-box input.
Six digits left too small a code space for the per-code and per-window attempt caps. The code stays numeric and is still generated with secrets; the sign-in forms do not validate its length, so only the example placeholders change.
Ported from makeplane#10301 (WEB-10169). The fork renamed the magic code to one_time_code, so the generator, the placeholder in all locales and the generation test are applied by hand to the renamed files. The four locales whose placeholder is a word example are left as they were, as upstream did. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Description
Magic sign-in codes were six digits. With five attempts per code and four codes per ten minutes per email, and no longer-term cap, that left a small code space open to slow guessing.
magic_code.py: codes are now eight digits (still numeric, still fromsecrets). The per-code attempt limit and the per-window code limit are unchanged.apps/spaceunique-code form and theauth.jsonlocale files) now show eight digits.A longer code was chosen over a longer lockout because a lockout would make it cheaper for someone else to lock a user out of magic sign-in.
Behavior change: users type eight digits instead of six. Nothing in the web, space or email templates validates the length.
Not changed: the email-change confirmation code in
app/views/user/base.pyhas its own generator and stays at six digits; it needs a signed-in session.Type of Change
Screenshots and Media (if applicable)
Test Scenarios
test_generated_code_is_eight_digitsinplane/tests/contract/app/test_authentication.py; the module passes (43 passed).packages/i18n/scripts/sync-check.ts --ci: all locales in sync.References
Created with Claude Code
Summary by CodeRabbit