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.

Hey team!

This topic seems related to our new EA feature, Forms for Actions, which rolled out of the beta stage on May 7th. Our Product team prepared the whole Documentation page with examples of Use cases. Forms for Actions. If you find yourself having questions regarding this new feature for the next two weeks, we are hosting an Ask Me Anything session. Our Product Expert will provide comprehensive written answers on May 21st from 8 AM to 10 AM PST.
Find out more about Forms for Actions and learn more about AMA.

Thanks!
Dawid

1 Like