Pre Registration hook not running when creating a Passwordless user


I’m in a scenario where I create Passwordless users using the management API. For each created user I’d like to run a Pre-registration hook but those don’t seem to be working when using the Paswordless connection. I tried with the Username-Password-Authentication DB and there it runs fine.

According to the docs

The Pre-User Registration extensibility point is available for Database Connections and Passwordless Connections.

My hook is basically the template one but I put it here for reference

module.exports = function (user, context, cb) {
  var response = {};

  response.user = user;

  // Add user or app metadata to the newly created user
  response.user.user_metadata = { foo: 'bar' };
  response.user.app_metadata = { vip: true, score: 7 };

  cb(null, response);

After creating the user in the Passwordless DB with the API, I do not see those metadata. When I create a user in the Username-Password-Authentication DB, I do see them

Did I miss something?

thanks for your help

1 Like

Hey @JanC,

I have tested and can confirm the same behavior for passwordless sms and email.

During a passwordless signup (sms or email) the pre reg hook runs, but the user_metadata is never set. The same hook works fine with a db connection signup.

When i checked further internally it has been already filed as a bug with our engineering teams and it has been added as a backlog item. I don’t have an ETA though on this at the moment!


Hi @sidharth.chaudhary

thanks for your answer and for confirming that it’s a bug in your backlog.

Is there a way to get notified when it’s fixed?


Hey @JanC,

No direct way as such. to get the status, you can either check back in the community after sometime or open a support ticket with our support team to check the status after some time.


1 Like

is there any workaround for the time being? Or maybe can you advice me how to solve this use case:

For any created user in Auth0, we need to create a user in our internal DB and associate our internal_user_id with the Auth0 user.

This internal_user_id is then sent inside the JWT in the meta data to the user app. Each request from the app sends the JWT (including the internal_user_id to our servers). This allows to associate each requests from the app to the user who sent it.

(We use Hasura and its Auth0 plugin)

I believe the Per-User Registration hooks were made exactly for this scenario. The problem is that since they don’t work for the OTP connections, it makes it impossible for us to use Auth0 as an authentication provider.

thanks in advance