cancel
Showing results for 
Search instead for 
Did you mean: 

Get rid of redirect to homepage when signing out magento 2

Get rid of redirect to homepage when signing out magento 2

This seems weird this is a thing. Why would it not just sign them out and keep them on the page they are at? 

 

Is there a way to just log them out and keep them on the page they are on? That weird "you will be redirected to the homepage in 5 seconds" seems like a poor UX

1 REPLY 1

Re: Get rid of redirect to homepage when signing out magento 2

Override the logout phtml template and update the redirect url.
vendor/magento/module-customer/view/frontend/templates/logout.phtml:14
Change the $block->getUrl() to the url where you want to be redirected.

$($.mage.redirect("<?php /* @escapeNotVerified */ echo $block->getUrl() ?>", "assign", 5000));

 

If issue solved, Click Kudos & Accept as Solution.
LitCommerce - The Most Simple & Affordable Multi-channel Selling Tool