Redirect in the pre-registration action flow

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