# Route to different view, depending on role, after login VUE

**URL:** <https://community.auth0.com/t/route-to-different-view-depending-on-role-after-login-vue/81136>\
**Category:** Get Help\
**Tags:** forum, login, auth0\
**Created:** [April 5, 2022, 9:24am UTC](https://community.auth0.com/t/route-to-different-view-depending-on-role-after-login-vue/81136 "2022-04-05T09:24:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaptenkeps](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kaptenkeps/32/33596_2.png) [@kaptenkeps](https://community.auth0.com/u/kaptenkeps)\
**Post date:** [April 5, 2022, 9:24am UTC](https://community.auth0.com/t/route-to-different-view-depending-on-role-after-login-vue/81136/1 "2022-04-05T09:24:55Z")

</div>

Hello! I’ve encountered an issue that may come up during a project of mine.

Lets say i have 3 roles in my auth0, X, Y and Z. In my vue app i have the homepage “/” path, where i log in.  
After the login, i want to direct to different routes, depending on the role, so lets say i log in as role X, i want to go to “/Xhome”, and with Y, go to “/Yhome” and so on.

Anyone got experience of this?

Thanks in advance

---

<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:** [April 12, 2022, 12:08am UTC](https://community.auth0.com/t/route-to-different-view-depending-on-role-after-login-vue/81136/4 "2022-04-12T00:08:56Z")

</div>

Hi there @kaptenkeps! Have you had any luck progressing with this?

> [@kaptenkeps](#):
>
> After the login, i want to direct to different routes, depending on the role, so lets say i log in as role X, i want to go to “/Xhome”, and with Y, go to “/Yhome” and so on.

It sounds like you may want to add user roles as custom claims to tokens and make routing decisions based on those. This can be achieved via an Action which will add the user’s role(s) as claims to an access/id token. This is typically a part of RBAC where roles group a set of permissions, but it seems this may work in this case as well.

> **[Sample Use Cases: Actions with Authorization](https://auth0.com/docs/manage-users/access-control/sample-use-cases-actions-with-authorization#add-user-roles-to-tokens)**
>
> Learn how to use Actions with roles-based access control (RBAC).

> **[Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac)**
>
> Understand the concept of role-based access control and how it applies in Auth0.

Hope this helps!

---

<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:** [May 25, 2022, 11:06pm UTC](https://community.auth0.com/t/route-to-different-view-depending-on-role-after-login-vue/81136/5 "2022-05-25T23:06:19Z")

</div>


