Skip to content

Magento 2.2.2 password reset strength meter #13429

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

Closed
zukovasmartynas opened this issue Jan 30, 2018 · 8 comments
Closed

Magento 2.2.2 password reset strength meter #13429

zukovasmartynas opened this issue Jan 30, 2018 · 8 comments
Assignees
Labels
Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@zukovasmartynas
Copy link

zukovasmartynas commented Jan 30, 2018

Preconditions

  1. Magento 2.2.2 Magento Open Source
  2. Nginx
  3. Developer mode, html/css/js minify/merge/bunlding disabled.

Steps to reproduce

  1. Install Magento 2.2.2 CE
  2. Remove footer newsletter block for the customer_account_createpassword handle
    <referenceContainer name="form.subscribe" remove="true"/>
  3. Create any customer account.
  4. Logout on frontend and go to login page and click "Forgot Your Password?"
  5. Fill created customer email and click "Reset password"
  6. Follow on the link "Set a New Password" in received email letter
  7. Try enter somekind of password to the New Pasword field

Expected result

  1. Strength meter starts working, showing a different password strength as I type

Actual result

  1. Strength meter doesn't work.
    Error on the console.
    Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
    Went to the vendor/magento/module-customer/view/frontend/web/js/password-strength-indicator.js:77
    if (password.toLowerCase() === this.options.cache.email.val().toLowerCase()) {

Apearently this.options.cache.email is undefined. Checked code above where it is declared - line:34
this.options.cache.email = $(this.options.formSelector).find(this.options.emailSelector);
Checked values above:
this.options.formSelector = 'form'
this.options.emailSelector = 'input[type="email"]'

So in conlusion: email is being searched in any form, Meaning if there are no form with email - strength meter fails. I believe this can be a leftover from older code versions, because othervise this would be a bit of a nonsense.

I haven't created a branch for a fix, but I think this one would be an easy one:

  • Make form selecter to select a right form (the one that is used to reset password)
  • Add a hidden field in the form with type email with value of a customer that is reseting this password.
    Or just make do something else - its just a suggestion, if that compare is really needed.

I hope this will help someone and it will be fixed :)

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jan 30, 2018
@zukovasmartynas zukovasmartynas changed the title Magento 2.2.2 pasword reset strength meter Magento 2.2.2 password reset strength meter Jan 30, 2018
@magento-engcom-team magento-engcom-team added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Feb 7, 2018
@magento-engcom-team
Copy link
Contributor

@zukovasmartynas, thank you for your report.
We've acknowledged the issue and added to our backlog.

@magento-engcom-team magento-engcom-team added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Feb 7, 2018
@okorshenko
Copy link
Contributor

okorshenko commented Feb 21, 2018

1d8157e

@aoldoni
Copy link
Contributor

aoldoni commented Feb 21, 2018

I was able to reproduce this one in 2.2.2.

I have a small fix for the issue described above for the frontend user. I am, however, further checking the above commit posted by @okorshenko and the backend and setup steps, as to see if they are affected as well.

@okorshenko
Copy link
Contributor

#MLAU18

@aoldoni
Copy link
Contributor

aoldoni commented Feb 21, 2018

I will proceed with submitting the PR now.

aoldoni added a commit to aoldoni/magento2 that referenced this issue Feb 21, 2018
…doing the email comparison only if an email field exists
magento-engcom-team added a commit that referenced this issue Feb 22, 2018
…3429 #13761

 - Merge Pull Request #13761 from aoldoni/magento2:fix-password-reset-strength-meter
 - Merged commits:
   1. 4e02365
   2. ceaa886
magento-engcom-team added a commit that referenced this issue Feb 22, 2018
Accepted Public Pull Requests:
 - #13770: Remove not-allowed currencies from the currencies dropdown in Setup (by @r-martins)
 - #13759: Add ObserverInterface to the api (by @fooman)
 - #13761: Fix bug Magento 2.2.2 password reset strength meter #13429 (by @aoldoni)
 - #13678: Add RewriteBase directive template in .htaccess file into pub/static folder (by @ccasciotti)
 - #13742: Fix adding values to system variable collection unit test. (by @nmalevanec)
 - #13740: Display a more meaningful error message in case of misspelt module name unit test. (by @nmalevanec)
 - #13586: Add option to add IP address to existing list (by @barryvdh)
 - #13661: Typo (address not addres) (by @srenon)
 - #13643: Fixes #12791 - Use a selector to only select the correct tax rate sel� (by @hostep)
@okorshenko
Copy link
Contributor

The issue has been fixed in #13761

@okorshenko okorshenko added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Feb 22, 2018
serhii-balko pushed a commit to serhii-balko/magento2 that referenced this issue Feb 23, 2018
…doing the email comparison only if an email field exists
@magento-engcom-team
Copy link
Contributor

Hi @zukovasmartynas. Thank you for your report.
The issue has been fixed in #13819 by @serhii-balko in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Feb 26, 2018
magento-engcom-team added a commit that referenced this issue Feb 26, 2018
…ength meter #13429 #13819

 - Merge Pull Request #13819 from serhii-balko/magento2:2.3-develop-PR-port-13761
 - Merged commits:
   1. 99b32cf
   2. fd5e0b5
@sidolov
Copy link
Contributor

sidolov commented Aug 9, 2018

Hi @zukovasmartynas. Thank you for your report.
The issue has been fixed in #17290 by @jignesh-baldha in 2.1-develop branch
Related commit(s):

The fix will be available with the upcoming 2.1.16 release.

@sidolov sidolov added the Fixed in 2.1.x The issue has been fixed in 2.1 release line label Aug 9, 2018
magento-engcom-team added a commit that referenced this issue Aug 9, 2018
… meter #13429 #17290

 - Merge Pull Request #17290 from jignesh-baldha/magento2:2.1-develop-PR-port-13761
 - Merged commits:
   1. 58280ac
   2. 74e3a12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

5 participants