I’ve been having issues trying to populate metadata in a pre-user-registration action using a passwordless sms connection. I want to allow user signups but also check to see whether the user’s phone number has already been whitelisted on our application database with an invite. I stumbled across this topic explaining that it’s a known bug that api.user.setAppMetadata doesn’t fire during pre-registration using passwordless connections, which leads me to think that this is also true for setUserMetadata: Adding user to default role, passwordless flow - #4 by mitchell.anderson
Is this still an active issue, and if so, is there any information on when a fix might be coming? I don’t have a firm idea of how to alternatively implement this. Perhaps with an older hook or rule?
I have just tested the Pre-User Registration Hook and can confirm your observations.
Currently, this is a known bug and included in our Engineers backlog to fix once our code freeze has lifted. The freeze is anticipated to be lifted early in 2022.
For now, I recommend using a Rule or Action as a workaround. Take a look at this Rule and Action examples for details.
Hoped this answers your questions.
Please let me know if there’s anything else I can do to help.
To be clear, I was trying to use the pre registration action, not the hook, but after time spent today on this it appears that the hook is also affected by this bug.
I have just tested the api.user.setAppMetadata() method in a PreUserRegistration Action flow and did not encounter any issues. I could successfully set the app_metadata for the user.
After testing your script myself, I could set the user app_metadata and the result is below:
Please note that I used the integers 1 to 5 for my array of IDs for testing. Everything works as expected.
With that, I can confirm that the PreUserRegistration Action flow can set the app_metadata and that your script has no issues.
Now, could you please re-confirm if this is your observation as well?
In my case pre-user-registration is not even being triggered during the time auth0 sends SMS or after the client calls for the access token. Does auth0 support pre-user-registration action for passwordless SMS connection?
I recommend using console.log() statements in your action script with the Real-time Webtask Logs Extension to track if the script is being triggered in your flow or any errors you may have.
@rueben.tiow Thank you so much, I can see logs coming from the extension you suggested. Can you tell me why action logs are not part of the regular logs?
I am facing the same issue. I can see logs from pre-user-registration actions in Real-time Webtask Logs Extension , but the action is not in in regular logs. This is a for a passwordless email signin.
After doing some tests myself, I can confirm that the Pre-User Registration Action logs do not appear in the regular logs for a Passwordless Email login.
I have reached our to our Engineering and Product teams regarding this and I will follow up once I have an update.
Update: Passwordless login does not support an explicit sign up flow, so each login is a mix of sign up and login. Hence why the Pre-User Registration action logs do not appear in the regular logs for Passwordless email.