Set the Login with Redirect for SSO to Sign-up by default

I’m using the Auth0 Single Page App SDK for React.js and I’m trying to set the LoginWithRedirect() method to navigate to the sign-up page by default instead of the login page. I’m using the Auth0 redirect page for my SSO, how can I accomplish this?

I tried this but it didn’t work.

import { useAuth0 } from '../react-auth0-spa'
...
const { loginWithRedirect } = useAuth0()
...
<button
    onClick={() =>
        loginWithRedirect({ initialScreen: 'SignUp' })
    }
    >
    Sign-Up
</button>

Are you using the Classic or the New ULP (Universal Login Page); the option you choose under Auth0 Dashboard > Universal Login?

In case of the Classic ULP, see:

In case of the New ULP:

loginWithRedirect({ screen_hint: 'signup' })
2 Likes

I was using the Classic and your solution worked. Thank you.

1 Like

Happy to hear :slight_smile:

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