Pre Registration Action not running when creating a Passwordless user

Hi,
I’m trying to setup a Pre Registration action exactly as described in the docs but the
action does not seem to be running for Passwordless connections.

I used the template action:

exports.onExecutePreUserRegistration = async (event, api) => {
  api.user.setUserMetadata("favorite_color", "purple"); 
};

Then in my passwordless email connection, I enabled the signups. When a new users performs a OTP login, the new user is correctly inserted into the Auth0 users but the action did not run.

I tried just denying the signups in the action to make sure the action runs but it also does not seem to be running.

exports.onExecutePreUserRegistration = async (event, api) => {
    api.access.deny("no_signups", "sorry")
};

What am I doing wrong?

My actual use case is that I want to insert this new user into my own DB (outside if Auth0) and then associate my own DB userId to the Auth0 user metadata. I’m using the " Pre User Registration" action because it is “blocking” as opposed to the “Post User Registration” which is non blocking.

I see there are some other (closed) topics where mentioning a bug on Auth0 side. Is this supposed to work?

thanks for your help

After some debugging, it seems that the “Pre User Registration” flow is completely ignored for passwordless singnups.

The issue was the same for the Hooks. I opened a topic here 3 years ago (Pre Registration hook not running when creating a Passwordless user)) but it was never implemented on the Hooks. I’d hope that the new Actions would fix this but it does not seem to be the case

I also found this FAQ Cannot set AppMetadata or UserMetaData in Passwordless flow with Pre-registration Action / Hook which says

With Passwordless connections, it is not supported to use the pre-registration Action because it works differently than with the other connection types.

but the docs themselves say:

The Pre User Registration Flow runs before a user is added to a Database or Passwordless Connection.

:man_shrugging:

Hey there!

As this topic is related to Actions and Rules & Hooks are being deprecated soon in favor of Actions, I’m excited to let you know about our next Ask me Anything session in the Forum on Thursday, January 18 with the Rules, Hooks and Actions team on Rules & Hooks and why Actions matter! Submit your questions in the thread above and our esteemed product experts will provide written answers on January 18. Find out more about Rules & Hooks and why Actions matter! Can’t wait to see you there!

Learn more here!