After login redirect user on previous page from front-end.
I am using the login pop-up and all default functionality. Also the Admin configuration Redirect Customer to Account is set as No. But it redirect me on Customer Dashboard
.
customerloginmagento2redirect-url
After login redirect user on previous page from front-end.
I am using the login pop-up and all default functionality. Also the Admin configuration Redirect Customer to Account is set as No. But it redirect me on Customer Dashboard
.
Best Answer
We can config in Admin: STORES > Configuration > CUSTOMERS > Customer Configuration > Login Options > Redirect Customer to Account Dashboard after Logging in > No.
When enabled this config, the login url will have a referer param to base64 encode url, like:
http://{website_url}/customer/account/login/referer/aHR0cDovL2xvY2FsaG9zdC9tYWdlMjE=/
Technically, we should take a look:
vendor/magento/module-customer/Controller/Account/LoginPost.php
vendor/magento/module-customer/Model/Account/Redirect.php
UPDATE: Please delete your local storage, this feature will work well. Please read more here.
Magento Version:
-Magento version 2.1.0