Hi, my ask is similar to this one:
Hi all,
We are investigating pre-registration actions and we are using GitHub - auth0/auth0-react: Auth0 SDK for React Single Page Applications (SPA) library with “New Universal Login”.
Are we able to pass a custom parameter from to Auth0 sign-up page and forward it to the pre-registration action (after the user clicks on the sign-up button)?
We need those parameters only during the registration process. We need to use that parameter to determine if the user is eligible for registration or no…
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:
opened 05:54AM - 27 May 22 UTC
closed 06:10AM - 31 May 22 UTC
### Description
I am trying to branch the process using the value of custom_p… aram in the context for the user who signed up.
In `@auth0/auth0-react`, `loginWithRedirect()` I was able to pass custom_param to Option.
How is this correct in `@auth0/nextjs-auth0`? Or is this not possible at the moment?
### Environment
- **Version of this library used:**: "@auth0/nextjs-auth0": "^1.9.0"
- **Version of the platform or framework used, if applicable:**: "next": "12.1.6"
Good find! I will give this a try. A bit convoluted but better than nothing I suppose