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:
I’m trying to accomplish what the question linked below is doing, but from the auth-spa-js framework.
Customizing the universal login widget is straightforward, but when I try to use it from loginWithRedirect(), I can’t figure out how to send a custom parameter the way that you can with WebAuth (by passing { mode: ‘signUp’ | ‘login’ } as an option).
Is there a way to accomplish this?
Thanks!
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
system
Closed
March 25, 2020, 7:15pm
5
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.