I am using the example code for ReactJS and the Hosted Login flow. It works great. I also have a server that has protected endpoints which assess the access token from the Hosted Login (Authorization: Bearer …). Works like a charm.
The only concern I have is this. The very first time a user signs up, I need to create a record on the server side (api) database before the SPA can really do anything useful. I see two ways of creating that database record:
- Use a Rule from Auth0 to make the request to the server side database
- Use ReactJS to make the request to the server side database after the Hosted Login redirects back to the app wait just for the response before continuing
My concern about #1 is that I need the Rule to wait until the request to the server side database is complete before continuing and redirecting the user back to the application.
Any thoughts would be much appreciated.