Skip to content

Commit 09baf84

Browse files
haverchuckdnys1
authored andcommitted
fix(amplify_authenticator): trims strings for password confirmation diffs (#1653)
1 parent 5f61fe7 commit 09baf84

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/amplify_authenticator/lib/src/state/authenticator_state.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class AuthenticatorState extends ChangeNotifier {
105105
String get password => _password;
106106

107107
set password(String value) {
108-
_password = value;
108+
_password = value.trim();
109109
notifyListeners();
110110
}
111111

@@ -157,7 +157,7 @@ class AuthenticatorState extends ChangeNotifier {
157157
String get newPassword => _newPassword;
158158

159159
set newPassword(String value) {
160-
_newPassword = value;
160+
_newPassword = value.trim();
161161
notifyListeners();
162162
}
163163

packages/amplify_authenticator/lib/src/utils/validators.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ FormFieldValidator<String> validatePasswordConfirmation(
112112
context,
113113
InputResolverKey.passwordConfirmationEmpty,
114114
);
115-
} else if (getPassword() != passwordConfirmation) {
115+
} else if (getPassword() != passwordConfirmation.trim()) {
116116
return inputResolver.resolve(
117117
context, InputResolverKey.passwordsDoNotMatch);
118118
}

0 commit comments

Comments
 (0)