Skip to content

Commit 13fb462

Browse files
MAGETWO-88274: [Forwardport] Fix bug Magento 2.2.2 password reset strength meter #13429 #13819
- Merge Pull Request #13819 from serhii-balko/magento2:2.3-develop-PR-port-13761 - Merged commits: 1. 99b32cf 2. fd5e0b5
2 parents a083717 + fd5e0b5 commit 13fb462

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/code/Magento/Customer/view/frontend/web/js/password-strength-indicator.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ define([
3131
this.options.cache.label = $(this.options.passwordStrengthMeterLabelSelector, this.element);
3232

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

77-
if (password.toLowerCase() === this.options.cache.email.val().toLowerCase()) {
79+
// We should only perform this check in case there is an email field on screen
80+
if (this.options.cache.email.length &&
81+
password.toLowerCase() === this.options.cache.email.val().toLowerCase()) {
7882
displayScore = 1;
7983
} else {
8084
isValid = $.validator.validateSingleElement(this.options.cache.input);

0 commit comments

Comments
 (0)