3

When I'm trying to reset password through reset link from my mail, it's showing following error:

Your password reset link has expired.

When I check my password reset link it looks like:

http://example.com/index.php/customer/account/resetpassword/?id=327

the reset password token is not generating I've checked the reset password template and it's looking fine:

<a href="{{store url="customer/account/resetpassword/" _query_id=$customer.id _query_token=$customer.rp_token}}"><span>Reset Password</span></a>

and I didn't update anything in my AccountController.php

public function changeForgottenAction()
{
    try {
        list($customerId, $resetPasswordLinkToken) = $this->_getRestorePasswordParameters($this->_getSession());
        $this->_validateResetPasswordLinkToken($customerId, $resetPasswordLinkToken);
        $this->loadLayout();
        $this->renderLayout();
    } catch (Exception $exception) {
        Mage::log($exception);
        $this->_getSession()->addError($this->_getHelper('customer')->__('Your password reset link has expired.'));
        $this->_redirect('*/*/forgotpassword');
    }
}
2
  • I have experience the same thing. Did you find a solution? Apr 19, 2017 at 17:17
  • You are missing the password reset token in your url, see my solution. It should show something similar to this: customer/account/resetpassword/?id=585&token=941a6fad20d128b4e04cbab260060b19 Jun 30, 2017 at 14:56

3 Answers 3

1

You'll need to do some digging, as seen the catch (Exception $e){} method catches any exception and outputs that message.

Try logging the exception:

Mage::log($e, null, 'customer_password_reset.log');

Then you can inspect the log file & identify what is causing the issue & figure out how to resolve it.

1
  • I am new to php, how can i apply catch (Exception $e){} into my code and how to find the issue? could you pls help me to find out the error?@Moose
    – Gem
    Jun 13, 2019 at 5:57
0

It can be related to a template file. I experienced the same error when i tried to update my password.

Try to replace the following in: /app/design/frontend/base/default/template/customer/form/resetforgottenpassword.phtml

Before:

<form action="<?php echo $this->getUrl('*/*/resetpasswordpost'); ?>" method="post" id="form-validate">

After:

<form action="<?php echo $this->getUrl('*/*/resetpasswordpost', array('_query' => array('id' => $this->getCustomerId(), 'token' => $this->getResetPasswordLinkToken()))); ?>" method="post" id="form-validate">

After you changed it please try again.

2
  • overwriting core files is very dangerous during magento upgrade right? @Frank Groot
    – Gem
    Jun 13, 2019 at 5:58
  • @Gem Yes that's true those edits will get overwritten while upgrading Jun 13, 2019 at 14:16
0

Maybe you use old email templates:

Replace

{{store url="customer/account/resetpassword/" _query_id=$customer.id _query_token=$customer.rp_token}} with

{{store url="customer/account/resetpassword/" _query_id=$customer.rp_customer_id _query_token=$customer.rp_token}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.