Repository navigation
Loosen the Research reset-code check to non-empty input - #1598
Merged
Merged
Conversation
The form required ^[A-Z0-9]{8,32}$ after trimming the ends, so a code
with interior whitespace was rejected, and maxLength={32} silently cut
off a pasted 32-character code that carried stray whitespace.
Strip all whitespace, uppercase, and only block empty input. The backend
is the validator; the form no longer guesses at the code's shape.
Refs #1580
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
|
Maple development preview: https://3e789ffa.maple-ca8.pages.dev Commit: Uses development API, billing, flags and PCR configuration. Cloudflare Access applies. |
AnthonyRonning
approved these changes
Nov 12, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #1580. The backend half is in #1552, so this PR does not close the issue on its own.
Summary
patternattribute and uppercases the code on submit. This PR handles what was left.^[A-Z0-9]{8,32}$after trimming only the ends, so a code with whitespace inside it was rejected. It now strips all whitespace, uppercases, and blocks only empty input. The backend is the validator; the form no longer guesses at the code's shape or length.maxLength={32}is removed. It silently cut off a pasted 32-character code that carried stray leading or trailing whitespace.Behavior to be aware of
abcd-1234) now reach the backend and count against the reset request's attempt limit. That is the trade Research password reset: reset-code regex is too strict (rejects lowercase) #1580 asked for.Validation
In
apps/maple-research/frontendthrough the pinned Nix shell:bun test src/components/PasswordResetFlow.test.tsx: 37 pass, 0 failbun run typecheck: passeslintandprettieron the two changed files: cleanNot run: the full frontend test suite, or the form in a running app against a backend.
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.