FosUserBundle: how to redirect after login to profile page

As you might know, the FosUserBundle redirects users after login to home page. In this tutorial I will explain how you can change this and redirects users to their profile page or another page.

So, open your security file, and add this code:

default_target_path: fos_user_profile_show
always_use_default_target_path: true

Now, FosUserBundle will redirect users after login to their profile page!

If you want to redirect them to other page, change the fos_user_profile_show route with other route.

Leave a Comment