Docs

Implement Passwordless Email with Magic Links in Regular Web Apps

Implement Custom Actions Using Pre-User Registration Extensibility PointsBeta

For Database Connections, the Pre-User Registration extensibility point allows you to add custom data points to a newly-created user's profile.

This allows you to implement scenarios such as setting conditional information (in the form of metadata on users that do not exist yet.

Implement a Hook using this extensibility point with either the Dashboard or the Command Line Interface.

Setup

Starter code and parameters

After you've created a new Hook that uses the Pre-User Registration extensibility point, open up the Hook and edit it using the Webtask Editor embedded in the Dashboard.

The parameters listed in the comment at the top of the code indicate the Auth0 objects (and the parameters within the objects) that can be passed into and used by the Hook's function.

The callback function cb at the end of the sample code is used to signal completion and must not be omitted.

Configure an email provider

Response

The default response object every time the Hook runs is similar to the following:

If you specify app_metadata and user_metadata in the response object, Auth0 adds this information to the new user.

Metadata property names must not start with the $ character or contain the . character.

Configure the connection

Testing your Hook

Executing the code using the Runner requires a save, which means that your original code will be overwritten.

Once you've modified the sample code with the specific Passwordlessscopes of additional claims you'd like added to your Allowed callback URLsAccess Tokens, test your Hook using the Runner. The runner simulates a call to the Hook with the appropriate user information body/payload. The following is the sample body that populates the Runner by default (these are the same objects/parameters detailed in the comment at the top of the sample Hook code):

Multi-Language Support

Example: Add metadata to new users

Using the test runner, we see that the response, reflecting the updated metadata, is as follows:

The Pre-Registration Hook does not currently pass error messages to any Auth0 APIs.