I have a symfony2 application working with a single firewall configured with FOSUserBundle to handle ongoing user support. It works great.
However, I want to have no more than one login form / page. I need a "standard" / login page that is used by the firewall, but I also want to embed forms on other pages for easier access to the account.
For example, on the page / booking / require _login, I tried to implement the login form template from FOSUserBundle, which is quite simple. I set _target_path to succeed. However, if this is a failed login attempt, I will be redirected back to the standard / registration form, and will not stay on my page / booking / require _login for visualization with corresponding errors. I see that there is a failure_path parameter, but it looks like something global, and not something that you can pass as the _target_path parameter.
It seems to me that I'm probably pushing the hacker approach further than it can go.
I do not need a separate firewall, this is just an alternative way to access the same login with the same set of restrictions.
Can anyone suggest any pointers to a clean (or simple!) Approach?
source share