I would like to have the user redirected to homepage instead of dashboard as soon as he logs in.


Use plugin concept and redirect to magento2 home page after login user successfully.


<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
  <type name="\Magento\Customer\Controller\Account\LoginPost">
    <plugin name="vendor_module_loginpostplugin" type="\Vendor\Module\Plugin\LoginPostPlugin" sortOrder="1" />


namespace Vendor\Module\Plugin;
class LoginPostPlugin

     * Change redirect after login to home instead of dashboard.
     * @param \Magento\Customer\Controller\Account\LoginPost $subject
     * @param \Magento\Framework\Controller\Result\Redirect $result
    public function afterExecute(
        \Magento\Customer\Controller\Account\LoginPost $subject,
        $result->setPath('/'); // Change this to what you want
        return $result;


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