How to change initial screen to Sign Up using auth0-spa-js (universal login)?

Hello, how I can set initial authentication screen on auth0-spa-js? By default it’s always login, however, we would like to open sign up form first in some cases. Any help would be highly appreciated.

const client = await createAuth0Client({
      domain: REACT_APP_AUTH0_DOMAIN || "",
      client_id: REACT_APP_AUTH0_CLIENT_ID || "",
      redirect_uri: REACT_APP_AUTH0_REDIRECT_URI || "",
      audience: REACT_APP_AUTH0_AUDIENCE_API,
      scope: "openid email profile",
    });

    this.auth0 = client;
  }

  async login() {
    await this.auth0.loginWithRedirect();
  }

  async signup() {
    // How can set it here?
    await this.auth0.loginWithRedirect();
  }
1 Like

Hey there @lukas!

Let me find that for you and get back here soon!

@konrad.sopala Thank you. I will be waiting!

@konrad.sopala Hello, no news on this yet?

Hey there!

I managed to get some info on this topic. So basically when using new Universal Login not the classic one, unfortunately it’s not possible to change initial screen.

Hi @lukas ,

are you using the New ULP or the Classic ULP - it’s not clear from the questions?

For the Classic ULP, the initialScreen parameter would be the way to go. But as @konrad.sopala said, it’s only available in the Classic ULP.

1 Like

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

Update on this: the New ULP now also supports it by passing the following parameter to the authorization request.

screen_hint='signup'
1 Like

Thanks for updating that @mathiasconradt!