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 bug Magento 2.2.2 password reset strength meter #13429 #13761

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -31,6 +31,8 @@ define([
this.options.cache.label = $(this.options.passwordStrengthMeterLabelSelector, this.element);

// We need to look outside the module for backward compatibility, since someone can already use the module.
// @todo Narrow this selector in 2.3 so it doesn't accidentally finds the the email field from the
// newsletter email field or any other "email" field.
this.options.cache.email = $(this.options.formSelector).find(this.options.emailSelector);
this._bind();
},
Expand Down Expand Up @@ -74,7 +76,9 @@ define([
'password-not-equal-to-user-name': this.options.cache.email.val()
});

if (password.toLowerCase() === this.options.cache.email.val().toLowerCase()) {
// We should only perform this check in case there is an email field on screen
if (this.options.cache.email.length &&
password.toLowerCase() === this.options.cache.email.val().toLowerCase()) {
displayScore = 1;
} else {
isValid = $.validator.validateSingleElement(this.options.cache.input);
Expand Down