-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authenticator: fix issue where phone_number validation fails #1014
Conversation
This fixes an issue where 2223334444 phone number format fails when there are other form validation errors such as a short password. The fix ensures that formValues.phone_number is not mutated on each signUp call.
🦋 Changeset detectedLatest commit: 86ca9ce The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request is automatically being deployed by Amplify Hosting (learn more). |
if (formValues.phone_number) { | ||
formValues.phone_number = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix ensures that formValues.phone_number is not mutated on each signUp call.
You said it! Mutations are a huge risk!
I'm redoing #911, but that fixes phone_number
to always be a computed value in the form so that this logic doesn't need to live in the machine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Issue #, if available:
Closes #1008
Description of changes:
This fixes an issue where phone number validation fails for country code
+1
when there are other form validation errors such as a short password. This causes thephone_number
value to be mutated, andN
number of+1
's to be appended (where N is number of times the form has been submitted):The fix ensures that
formValues.phone_number
is not mutated on eachsignUp
call.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.