How to allow user to choose role at sign up? [React, Serverless]

Hi @c.ryberg,

Getting the user’s initial role could be done a couple of different ways. You could:

  • You could use a mandatory redirect rule. * I would look at this option first *

    • When a user signs up/logs in, you will check if they have any roles, if they don’t then redirect to a role selection page you create.
  • Set up additional fields on the signup page.

    • This will only work for database connection if you are using lock (no google or facebook support :frowning: )
  • Create a custom signup page.

    • This will likely take the most development.

Switching roles can be done in your app, they could make the request through a profile or settings page and your backend/API can make the update Auth0 management API.

Getting roles in the token is demonstrated in this example.