Empty event.request.body on pre user registration action

I’m including some custom parameters in my call to loginWithRedirect.
I’m using the sample app.

const options = {
      authorizationParams: {
        redirect_uri: window.location.origin,
        invitation: <invite>,
        organization: <org>,
        screen_hint: 'signup',
        customParam: <custom_param_value>,,
      },
    };
await auth0Client.loginWithRedirect(options);

I expected the event of the onExecutePreUserRegistration to have the request.body populated with the custom parameters as described in the documentation. Actions Triggers: pre-user-registration - Event Object (auth0.com). However when I use the web task logs extension to print out the event object the body is empty. Am I interpreting the documentation for this action incorrectly?

Hello @czf,

Welcome to the Auth0 community!

In order to pass the authorizationParams correctly you also need to provide required parameters. These are:

response_type: "id_token",
response_mode: "form_post",
scope: "openid profile email"

After adding these into authorizationParams, you should add your custom ones and they should be passed forward.

I hope this was helpful.

Thanks,
Tudor

I don’t see all of those listed in the doc for the authorizationParams.
scope is listed as optional
AuthorizationParams | @auth0/auth0-spa-js

Looking at the source for auth0-spa-js, response_mode doesn’t come from authorizationParams it comes from authorizationOptions which there doesn’t seem to be a way to set that.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.