Skip to content

Commit

Permalink
fix(storefront): BCTHEME-806 Password complexity error message does n…
Browse files Browse the repository at this point in the history
…ot reflect the requirements set in the store settings (#2117)
  • Loading branch information
jordanarldt authored Feb 21, 2022
1 parent e8b21c8 commit 7e389b0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Draft
- Fixed password complexity error not displaying the complexity rules set in the store settings [#2117](https://github.com/bigcommerce/cornerstone/pull/2117)
- Translation updates February 2022. [#2177](https://github.com/bigcommerce/cornerstone/pull/2177)
- Cornerstone performance optimizations: blocking scripts delaying DomContentLoaded. [#2158](https://github.com/bigcommerce/cornerstone/pull/2158)
- Cornerstone performance optimizations: remove unused fonts. [#2176](https://github.com/bigcommerce/cornerstone/pull/2176)
Expand Down
4 changes: 2 additions & 2 deletions assets/js/theme/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,15 @@ export default class Account extends PageManager {
}

if ($passwordElement && $password2Element) {
const { password: enterPassword, password_match: matchPassword, invalid_password: invalidPassword } = this.validationDictionary;
const { password: enterPassword, password_match: matchPassword } = this.validationDictionary;
editValidator.remove(passwordSelector);
editValidator.remove(password2Selector);
Validators.setPasswordValidation(
editValidator,
passwordSelector,
password2Selector,
this.passwordRequirements,
createPasswordValidationErrorTextObject(enterPassword, enterPassword, matchPassword, invalidPassword),
createPasswordValidationErrorTextObject(enterPassword, enterPassword, matchPassword, this.passwordRequirements.error),
true,
);
}
Expand Down
8 changes: 4 additions & 4 deletions assets/js/theme/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ export default class Auth extends PageManager {
}

registerNewPasswordValidation() {
const { password: enterPassword, password_match: matchPassword, invalid_password: invalidPassword } = this.validationDictionary;
const { password: enterPassword, password_match: matchPassword } = this.validationDictionary;
const newPasswordForm = '.new-password-form';
const newPasswordValidator = nod({
submit: $(`${newPasswordForm} input[type="submit"]`),
tap: announceInputErrorMessage,
});
const passwordSelector = $(`${newPasswordForm} input[name="password"]`);
const password2Selector = $(`${newPasswordForm} input[name="password_confirm"]`);
const errorTextMessages = createPasswordValidationErrorTextObject(enterPassword, enterPassword, matchPassword, invalidPassword);
const errorTextMessages = createPasswordValidationErrorTextObject(enterPassword, enterPassword, matchPassword, this.passwordRequirements.error);
Validators.setPasswordValidation(
newPasswordValidator,
passwordSelector,
Expand Down Expand Up @@ -157,7 +157,7 @@ export default class Auth extends PageManager {
}

if ($passwordElement && $password2Element) {
const { password: enterPassword, password_match: matchPassword, invalid_password: invalidPassword } = this.validationDictionary;
const { password: enterPassword, password_match: matchPassword } = this.validationDictionary;

createAccountValidator.remove(passwordSelector);
createAccountValidator.remove(password2Selector);
Expand All @@ -166,7 +166,7 @@ export default class Auth extends PageManager {
passwordSelector,
password2Selector,
this.passwordRequirements,
createPasswordValidationErrorTextObject(enterPassword, enterPassword, matchPassword, invalidPassword),
createPasswordValidationErrorTextObject(enterPassword, enterPassword, matchPassword, this.passwordRequirements.error),
);
}

Expand Down

0 comments on commit 7e389b0

Please sign in to comment.