Skip to content
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

Merged
merged 2 commits into from
May 31, 2022

Conversation

haverchuck
Copy link
Contributor

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.

@haverchuck haverchuck requested a review from a team as a code owner May 31, 2022 17:26
@@ -112,7 +112,7 @@ FormFieldValidator<String> validatePasswordConfirmation(
context,
InputResolverKey.passwordConfirmationEmpty,
);
} else if (getPassword() != passwordConfirmation) {
} else if (getPassword().trim() != passwordConfirmation.trim()) {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, sounds good. Thanks!

@haverchuck haverchuck merged commit fb84fe7 into aws-amplify:main May 31, 2022
dnys1 pushed a commit to dnys1/amplify-flutter that referenced this pull request Jun 13, 2022
dnys1 pushed a commit to dnys1/amplify-flutter that referenced this pull request Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passwords do not match in force_change_password page
3 participants