Magento – Magento 2.2.6 Customer Password Reset

change-passworderrormagento2.2.6password-recoverytroubleshooting

I have a problem with customer password reset in Magento 2.2.6
After pressing forgot password it send me an email " Set a New Password link "

but when i am trying to set new password i got a message

Something went wrong while saving the new password.

Here a Pic of error message

Also i checked

var/logs

But i dont have any problem with this all kind of emails setting are correct..
Any suggest?

Best Answer

This is a bug in Magento 2.2.6 and Magento 2.2.7. Go to the file vendor/magento/module-customer/Model/AccountManagement.php and patch it like this:

       Fix M2.2.7 - MAGETWO-96079: Cannot update password using received link

diff --git a/Model/AccountManagement.php b/Model/AccountManagement.php
index 8f25651..b5b1905 100644
--- a/Model/AccountManagement.php
+++ b/Model/AccountManagement.php
@@ -670,8 +670,8 @@ class AccountManagement implements AccountManagementInterface
         $customerSecure->setRpTokenCreatedAt(null);
         $customerSecure->setPasswordHash($this->createPasswordHash($newPassword));
         $this->getAuthentication()->unlock($customer->getId());
-        $this->sessionManager->destroy();
         $this->destroyCustomerSessions($customer->getId());
+        $this->sessionManager->destroy();
         $this->customerRepository->save($customer);

         return true;

More info:

https://github.com/magento/magento2/commit/7443dc3194040e9ce2f7baf902470deb975b97c6 https://github.com/magento/magento2/issues/18256

Related Topic