Auth0 Home Blog Docs

Handling first-time users when signup goes through the HLP?

angular
signup
hosted-login-page

#1

If I am using the hosted login page (HLP) and a new user signs up to my site, how can I detect that on the callback? I would like to send the user on a new user tour of the site.


#2

It depends on your exact requirements, but you have a few options:

  1. if your application maintains its own store for end-user related data, like user generated content, application specific user settings or history of user actions then it should also be simple to store additional information that would flag if the user that just authenticated has already completed the tour. You could do this by simply associating a boolean flag to the unique user identifier that your application receives after the end-user completes authentication through Auth0.
  2. if your application does not keep it’s own store of end-user data then you may be able to leverage user metadata to store a flag that indicates if this is a new user or a recurring user. Having that flag as part of user metadata would then enable you to include it as a custom claim so that the client application would know if the tour is to be shown or not.(if you go with this check the guidance docs)

In both options, end-users would be created without any flag so the tour would be shown; after having showed the tour the flag would be set in the user so that it would not be shown again.

For option 2. have in mind that the data you store at user metadata can in theory be available to all the client applications defined within your Auth0 account so I would personally only go with that for very simple scenarios or if you only have a group of client applications that you want to conceptually treat as the same; for example, web application and mobile applications where you would still only want the user to take the tour once across all applications.


#3