It might be a bug, or a feature, but we are experiencing pre-user-registration hooks running on “normal” login! (login type is passwordless).
Thanks for reporting this behavior! I am checking with the team about this.
I heard back from the team responsible for Actions/hooks, and I’ve created a ticket regarding this issue. Thanks again for reporting it!
I have run into the exact same issue with the Pre UserRegistration hook/custom action runs even when the user tries to login, where the login method is Passwordless + SMS.
The use case is fetching an external User Id and setting that value in the user’s metadata.
I am also having issues with the
api.setUserMetadata method. It does not work as excepted. The registered user’s metadata is empty.
I can create a separate ticket for this.
I’ve followed up about this to get an update and will let you know when I hear back.
Just to make sure, has the custom action been attached to a flow? Write Your First Action
Thanks, and yes the Custom Action has been attached to the Pre Registration Flow. I am able to get logs out of the Custom Action using the Auth0 Logs Extension. I can even log the body of the metadata I wish to persist. Unfortunately, when I inspect the body of the user’s metadata afterwards, it is empty.
I’ve heard back from Engineering that there is a known limitation in the pre-user registration action trigger that it will not set metadata using
api.setUserMetadata when using the Passwordless OTP flow. The documentation will be updated soon to clarify this limitation. There is also an item to fix this limitation, however, I don’t have a specific release date for when it will be resolved.
I’m experiencing the same bug, the pre-registration actions trigger when a user attempts to login using passwordless login. I have an action that denies access if a user is registered with an existing email which is obviously triggered on login since the user is logging in with an existing account. Am I misunderstanding the flows? I had assumed pre-registration would only run when I called for example