I’m trying to find out if it’s possible to allow a user to select their role on sign up, rather than giving them a default role. Additionally, I’d like the user also to be able to select the other role at a later time, after signing up.
This is the scenario:
- User is given the option to select from Role A or Role B while signing up. They select Role A, sign up and log in, and are able to see some pages and page content that is only shown to Role A users.
- Later, the user can edit their settings and also select Role B. Now they can see pages that are only shown to Role B users and also the earlier pages and content shown only for Role A users.
My set up is a serverless React app using the
Auth0Provider context. Ideally, I’d like to be able to get an array of
roles out of the
user object from the
useAuth0 hook, if possible.
Is there a recommended approach for this?
Thank you very much for the help.