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

**URL:** <https://community.auth0.com/t/how-can-i-redirect-the-user-based-on-his-role-after-logging-in/125371>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [January 22, 2024, 5:01pm UTC](https://community.auth0.com/t/how-can-i-redirect-the-user-based-on-his-role-after-logging-in/125371 "2024-01-22T17:01:25Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [January 22, 2024, 5:59pm UTC](https://community.auth0.com/t/how-can-i-redirect-the-user-based-on-his-role-after-logging-in/125371/3 "2024-01-22T17:59:23Z")

</div>

Hey there @borjan.kalinoski welcome to the community!

> [@borjan.kalinoski](#):
>
> Is this the way to go, or should I do this in our react application?
> 
> If this is the way to go, why am i not able to attach the user-role property to the tokens?

This is a valid approach and outlined in [this topic](https://community.auth0.com/t/redirect-user-depending-on-role-after-login/83610) - It’s hard to tell from the code snippet shared. Are you defining the `roles` variable elsewhere?

---

_[View the full topic](https://community.auth0.com/t/how-can-i-redirect-the-user-based-on-his-role-after-logging-in/125371)._
