How can i get the logged in user's roles?

so im workling on a frontend app using react js
there will be no backend

i setup auth0 to login and logout successfully

i now need to add RBAC,
in a previous project i was able to get the roles from the access token, but now the access token is invalid, it has one part missing, (theres 2 dots, so the part between the dots is missing)
also in the previous project i used “@auth0/auth0-react”: “^1.12.1”, and i am now using “@auth0/auth0-react”: “^2.2.4”.

i tried passing the audience, but it seems that Auth0Provider no longer accepts this value.

the docs seem like they are out of date, or im on the wrong docs…

my end goal is to get the roles assigned to a user,
how can i do this?

Hi @user4302

Welcome to the Auth0 Community!

Thank you for posting your question. There’s an option to add user’s roles to the Access Token via Post-Login action → Login Flow

Thanks
Dawid

Thank you for your fast response :face_holding_back_tears:

Ohhh. I did try to use the actions.
But couldn’t find anything regarding roles specifically.
(First time ever accessing actions)

What is the option called?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.