1

I had added the login form in the home page using the block, i inherited the block to home cms page the form is also viewing correctly but when iam using invalid credentials the page is redirected to default login page and showing the error i want to display all kind of error in cms page login section and want avoid the redirection to www.yourdomain.com/customer/account/login/

Inherited the block in cms home page:

{{block class="Magento\Customer\Block\Form\Login" template="Magento_Customer::home_login.phtml"}}

I also tried other ways like showing the login section using adding in cms_page_view.xml layout

The code added in the cms_page_view.xml

<container name="customer.login.container" label="Customer Login Container" htmlTag="div" htmlClass="login-container">
            <block class="Magento\Customer\Block\Form\Login" name="customer_form_login" template="Magento_Customer::form/login.phtml">
                <container name="form.additional.info" as="form_additional_info"/>
            </block>
            <block class="Magento\Customer\Block\Form\Login\Info" name="customer.new" template="Magento_Customer::newcustomer.phtml"/>
        </container>

This also behaving as same. When entering invalid credentials it redirects to www.yourdomain.com/customer/account/login/

Please give the solution for my problem.

Thanks in advance :)

Regards, Sabareesh

0

Try -

{{block class="Magento\Customer\Block\Form\Login" template="Magento_Customer::form/login.phtml"}}
| improve this answer | |
  • Thank you @Gagan, but I tired this also, the same action is happening when entering the invalid credentials. – Sabareesh Feb 25 at 9:30
  • I think you will need to override login post controller - magento.stackexchange.com/questions/179636/… – Gagan Feb 25 at 10:02
  • I had a doubt in that, we can use the plugin structure in above link without changing the controller page vendor\magento\module-customer\Controller\Account\LoginPost iam using the default LoginPost functionality – Sabareesh Feb 25 at 14:29
  • Yes, Plugin should be created. The verified answer uses Plugin only – Gagan Feb 27 at 6:24

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.