Here's my problem: I have a project translated in 2 languages (en & fr). In the security.yml, I've to configure a firewall (with a login form), and specifically the target path after logout:
logout:
path: /user/logout
target: /
But I can't choose the target path depending on user's culture...
I don't have this problem when signin, in fact I choose the target path directly in my login form:
<input type="hidden" name="_target_path" value="/{{ app.session.locale }}/" />
So I don't know how to redirect after logout on /fr/ if you are french, or otherwise /en开发者_JAVA技巧/ ... Do you have any solution ?
You can add a custom logout handler, see successHandler
property of Symfony\Component\Security\Http\Firewall\LogoutListener
. With the DIC you can easily override it.
精彩评论