-
Notifications
You must be signed in to change notification settings - Fork 238
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
fix(amplify_authenticator): trims strings for password confirmation diffs #1653
Conversation
@@ -112,7 +112,7 @@ FormFieldValidator<String> validatePasswordConfirmation( | |||
context, | |||
InputResolverKey.passwordConfirmationEmpty, | |||
); | |||
} else if (getPassword() != passwordConfirmation) { | |||
} else if (getPassword().trim() != passwordConfirmation.trim()) { |
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.
Can we trim them when we save them in authenticator_state.dart
in case this issue comes up elsewhere?
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.
@dnys1 That'll work for the password and newPassword fields (so I've made that chage), but I believe the actual password confirmation should be trimmed here since the FormField validator is using the content from the field and not from state.
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.
Yep, sounds good. Thanks!
Issue #, if available:
This PR potentially fixed #1592, but we will need additional feedback from the customer to confirm. The change is valid regardless of whether it fixes this particular issue.
Description of changes:
Trims strings in password confirmation comparison.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.