1
votes

I use this in my navbar on my web site

{{ render(controller('FOSUserBundle:Security:login')) }}

And i put the login form in my navbar where my login work when i put the correct data into.. my problem come when the data is incorrect because the render redirect me on the login.html.twig page for say me the error message. I think my problem is in this lines

     protected function renderLogin(array $data)
       {
      return $this->render('FOSUserBundle:Security:login.html.twig', $data);
    }

I try to change this, with the initial page or the directory of navbar but is not the good way..

How can i do??? I want the error message in the index and I do not want to redirect the login page..

1

1 Answers

0
votes

I personally had this problem; You can either override the login function of FOS, and handle the error when there's any, or do as i did, and create an ajax call for the login, and handle it yourself