I am currently using FOSUserBundle in my Symfony 3.4 based project. We have some front-end design changes planned and I want to integrate the login form to the standard page template for non-logged in users to be able to login wherever they are on the app.
In my template file I am calling:
{{ render(controller('FOSUserBundle:Security:login')) }}. This is correctly rendering the login form within the relevant pages.
However I have two problem I am unable to figure out how to overcome...
If the user enters invalid credentials, how can I return the user to the page they were on rather than the
/loginroute?How can I intercept the error message (Invalid credentials etc.)? I would want to make it a flash message and then display it elsewhere in the master template.
Happy to provide further information if required.
t2t