0

How Magento redirect the customer to account login controller form the account index controller?

1

In this case, you should check Magento\Customer\Controller\Plugin\Account and check the beforeDispatch() method.

0

This is the code which is responsible for redirecting the customer to the specified location after successful login.

    if (!$this->getScopeConfig()->getValue('customer/startup/redirect_dashboard') && $redirectUrl) {
         $this->accountRedirect->clearRedirectCookie();
         $resultRedirect = $this->resultRedirectFactory->create();
         // URL is checked to be internal in $this->_redirect->success()
         $resultRedirect->setUrl($this->_redirect->success($redirectUrl));
         return $resultRedirect;
    }

You can find the details in execute method in file vendor/magento/module-customer/Controller/Account/LoginPost.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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