Redirect in the pre-registration action flow

Hi,
in the Login flow it is possible to redirect user to an external application for example to collect additional user data. See Redirect with Actions

Is it possible to do the same in the pre-registration flow?

The pre-registration flow api object seems missing of the redirect support.

More in general, how I can collect additional user data during the registration flow?

Thanks,

Gualtiero

1 Like

Hi @gualtiero.testa,

Welcome to the Auth0 Community!

Unfortunately, you cannot redirect in a Pre-User Registration Action, as you have found.

Only the Post-Login Action can redirect users. Take note that whenever a user signs up, they are automatically logged in. As a workaround, you could check if the user’s login count equals 1, which indicates a new user logging in, and redirect as needed.

exports.onExecutePostLogin = async (event, api) => {
  if (event.stats.logins_count !== 1) {
    return;
  }
  api.redirect.sendUserTo("https://my-app.exampleco.com");
};

exports.onContinuePostLogin = async (event, api) => {
}

Alternatively, you could implement the additionalSignUpFields in your Universal Login page, but this will require you to switch from the New Universal Login experience to the Classic Universal Login experience.

See the following resources:

Thanks,
Rueben

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