I want to know how can i redirect a user to the Forgot Password page after exceeding the number of unsuccessful login attempts in Magento 2. Thanks.

  • Make it redirection in your Login controller but i don't know number of Unsucess attempt
    – Magento 2
    Nov 3, 2017 at 7:00
  • I have already set the number of unsuccessful attempts to 3. I just have to do the redirection. I'm new to Magento 2 btw.
    – Mudz7
    Nov 3, 2017 at 7:06
  • Override this Controller in your Module vendor/magento/module-customer/Controller/Account/LoginPost.php there you need to set forget psw url Don't edit core file
    – Magento 2
    Nov 3, 2017 at 7:22
  • Can you show me how to do that exactly?
    – Mudz7
    Nov 3, 2017 at 7:29

1 Answer 1


I have done this and it works.

                $resultRedirect = $this->resultRedirectFactory->create();
                return $resultRedirect;

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.