Passing custom parameters to pre registration action

Hi, my ask is similar to this one:

I need to pass a custom parameter to a pre registration action, or by some other means set a value in user_metadata before registration. This value is needed to customize the ‘validate email’ email sent by Auth0. If I use the login action then the value is not available in the metadata before the email is sent.

This is not relevant to security for me since it’s just adding some copy to an email. I’m not controlling access with this value. Also I do not wish to use the invitation flow as that is not straightforward enough for the user. Please advise on what options I have.

Thanks

This doesn’t seem possible for onExecutePreUserRegistration. I get an error in the logs for the action that event.request.query is undefined

Does anyone know if this is possible in any way?

I’m experiencing the same issue.

Have you found a solution for this by any chance?

Found a workaround, using custom prompts by adding a hidden input which is then accessible in the pre-reg action

<div class="ulp-field" hidden="hidden">
    <input type="text"
           name="ulp-custom-field" id="realm" value="{{transaction.params.ext-customField}}">
</div>

In the pre-reg action you can then do something like this:

exports.onExecutePreUserRegistration = async (event, api) => {
    const field = event.request.body['ulp-custom-field'];
}

Auth0 reference for the solution:
https://auth0.com/docs/customize/login-pages/universal-login/customize-templates#custom-query-parameters

This github issue showed how it should work:

Good find! I will give this a try. A bit convoluted but better than nothing I suppose