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
  • Loading branch information
jordanarldt committed Oct 27, 2021
1 parent 74b4671 commit 1224340
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)

## 6.1.0 (09-03-2021)
- Fixed images placeholder on hero carousel shifted on mobile when slide has content. [#2112](https://github.com/bigcommerce/cornerstone/pull/2112)
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 1224340

Please sign in to comment.