How can I redirect the user based on his role after logging in?

Hey there @borjan.kalinoski welcome to the community!

This is a valid approach and outlined in this topic - It’s hard to tell from the code snippet shared. Are you defining the roles variable elsewhere?