I am using the FOSUser Bundle for Symfony… My question is;
I have two different group of users…. For example; Teachers and Students, which it is set when they register to the system. (using the user table of FOSUser Bundle)
After a successful login, I want to user to go to the correct landing page.. So
If the user is a teacher, I want the user to go to /teacher and for student to /student.
What is the best way to approach this?
Thanks
You need an event listener to listen for an login event. Then you can route the client to different pages based on their roles.
services.yml:
LoginListener:
From: http://www.metod.si/login-event-listener-in-symfony2/