Passing custom parameters to pre-registration action from New Universal Login

Hi @sanjin.o,

Thank you for your response.

Let me take a step back and clarify a few things.

When calling the loginWithRedirect(options) function, you are inherently calling the /authorize endpoint. This endpoint is a reference to the Auth0 Authentication API.

In essence, the Auth0 React SDK uses Authorization Code flow with PKCE, which begins by calling the /authorize endpoint to exchange for an authorization code.

Now, circling back to your desired use-case, what you’ll need to do is to pass the custom parameter to the loginWithRedirect function as you’ve done so, and it will be passed into the query URL.

Then you can use this parameter with the Pre-User Registration Action, to obtain that parameter to allow or deny access.

See below: I passed person_1=true as my custom parameter and it’s in the Request URL.

Then, from here, you can use the Pre-User Registration Action Script to get your custom parameter and allow/deny access to the user. The script will trigger after the user presses the Sign Up button.

Finally, I’d like to point out that the screenshots you have shared with me are consistent with the Auth0-spa-js and not the Auth0-react.

Regardless, the approach I offered will work with the Auth0-spa-js SDK.

Please let me know if you have any other questions. I’d be happy to clarify!

Thank you.

1 Like