Magento – Your password reset link has expired : Magento 2

magento2

I am trying to reset password from forgot password action using REST API:

http://domain/index.php/rest/V1/customers/password?
email=myemail@gmail.com&
template=email_reset&
websiteId=1

and I receive an email successfully to set new password as follow:

enter image description here

When click the button Set a New Password, I got this error

Your password reset link has expired

as follow :

enter image description here

when enter my email again in the last screen, I got another email to reset a new password as the first image, then click reset password and I can receive the proper screen and reset password function working fine as follow :

enter image description here

Best Answer

First of all thanks @Shireen your comments help me to debug. I have kind of similar issue and it resolved not in the best way.

@Jsparo30

when you request reset password link via API, Magento creates DirectLink(Link with the query string, has 2 params) which are as follows.

please check this file /vendor/magento/module-customer/Controller/Account/CreatePassword.php

enter image description here and when you click the button on reset password email Magento try to access those query string params and get Failedenter image description here

due to they accessing the wrong param.

to overcome this problem quickly all you need to just replace param token with amp;token

I know this is not the solution, but you can at least start with this.

Related Topic