I am trying to figure out the best way to have a user be automatically added to a business entity in an app I'm building, if they have been invited by the admin of that business.
I am using Auth0 for authentication, but don't see a way to customise the objects to include a business id in the invite email,
is there a standard way applications go about this?
My only thoughts have been to
- admin creates account with app
- admin creates business entity which is stored in DB
- admin can add users emails - users emails are stored and marked as not accepted
- users are invited via email
- user signs up - the database is searched for an existing email assosited with a business if email exists change hasAccepted field to true?
I can see some logic flaws in this already, if anyone has done this flow before and has any tips on security or ease of flow/fewer db calls I would really appreciate it!
Thanks :)