Customising flows to use different roles

Hi I’m attempting to customise my rules to add extra data to the json file that is outputted on the react sample for Auth0 once you login and check your profile you can see a snippet of information such as your email and such.

I know you can assign roles with API’s automatically when a user joins and use this to give specific permissions and level of access.

However, I’m having a lot of difficulty in regards to creating a API call and an additional question in my login form after first sign-up or if the user hasn’t been assigned a role.

A pop up box after-ward if you will that fires a API and assigns a role.

For example you login, it asks

“Hi you’re new here, are you looking to create a business account or a client account?”

Business [ ] Client

As the user has selected a Business account they will be granted access to the page /Business and assigned the role “Business” to the account variable that will be in the data on the profile information.

I’m new to react and have been more CSS HTML and a bit of JS and am curious if this is out of my league currently too?

Thanks in advanced for help, hopefully it made total sense.

I’m interested in learning and hopeful for someone with a solution, enjoy your day.

Hi @chashsmurfis

Welcome to the Auth0 Community!

First of all, sorry for the late response. I’ll try to provide a potential solution to your problem.

From the description of your issue, I see the two roads you can take to achieve this. The first is to create a fully customized signup page, self-host it, sign and login users via API, and handle the exchange of information on your behalf. Custom Signup

Another approach to this problem is the usage of Lock configuration, which you will edit in the Auth0 code editor and add additional signup fields, which will be saved in the user metadata for later usage. For the boolean value of Business or Client, you can use the Select type of additional fields, which can be accessed from the user metadata in action or a different application.

Thanks
Dawid

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