DEV Community

Paboda Hettiarachchi
Paboda Hettiarachchi

Posted on • Updated on

Password reset - Magento 2

We always worry when a password reset needs to be done in our Dev environments when there is no email service installed.

Easiest way : Install n98 tool

wget https://files.magerun.net/n98-magerun2.phar
chmod +x ./n98-magerun2.phar
Enter fullscreen mode Exit fullscreen mode
php n98-magerun2.phar customer:change-password
Enter fullscreen mode Exit fullscreen mode

Another way
In M2, there is a way to do this if you have access to the Database.

When the password reset link is clicked and the email has been submitted, there will be a value for the rp_token column in datatable customer_entity in M2 database.
The parameter passed as the "token" will be the above value.

The parameter passed as the "id" will be customer ID (entity_Id in cstomer_entity datatable).

You can use the following link with the proper parameter values to reset the password.
https://test.com/customer/account/createPassword/?id=125565&token=5b029aeae4659db7939c38970680c45b

Latest comments (0)