Repository navigation
Verification code: no space in the email, and the field accepts a pasted code with spaces - #1077
Merged
Merged
Conversation
…ted code with spaces
The email showed the code as "504 452" with a real space, which was copied
along with the digits. The code field had maxLength={6}, so the browser cut
the 7-character paste to "504 45" before the digits were extracted and the
code could not be submitted. The email now shows the code as typed (the
box's letter-spacing still spaces it out), and the field keeps the first six
digits of whatever is pasted, so codes from emails already sent work too.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem. Copying the verification code from the email didn't work.
504 452with a real space between the halves, so the space was copied too.maxLength={6}. The browser truncates a paste to that length beforeonChangestrips non-digits, so504 452arrived as504 45: five digits, and the Verify button stayed disabled.Fix:
verificationEmailshows the code exactly as typed (504452). The box'sletter-spacing:10pxstill spaces the digits out visually, with no character in between.maxLength;onChangekeeps the digits of whatever is pasted, then the first six. Codes from emails already sent (with the space) work too, and so do spaces or dashes typed by hand.Tests:
email.service.spec.tsnow asserts>123456<and that the spaced form is absent (9/9 pass). Frontendtscis clean. The one eslint warning in the file (unusedtrialErr, line 381) is pre-existing.