I am trying to create a hook for a user during pre-registration to register the user to a company. Each user is required to join a company or create a new one during registration.
This is my first time using Auth0 Hooks
Any useful resources anyone knows online would be great.
In order for the user to join a company, do you need to send the data somewhere (make an API request) or do you just need to update the user’s metadata to store their company information?
If it is simply storing the company info in the user’s metadata, here is an example script to follow: Explore Flows and Triggers
If you are wanting to send the data elsewhere, you may want to use a post-user registration hook instead which is non-blocking and designed for asynchronous tasks.
Preferably, I would be able to check if a user has a company set, if not to route to create | join company page.
From there I wasn’t sure if it would be best to store the company data as user metadata within auth0 or just send that straight to my neo4j DB or both.
I plan on setting user roles within a company for Owner, Manager, Employee, Contractor, Customer.
In this case would it be best to set up the data as metadata within auth0 and setup roles?
I haven’t used auth0 much yet, recently switched to it with auth0/nextjs