Getting Auth0 React SDK to go directly to signup page

I’m struggling to find a solution to get the React SDK to go directly to the signup page. I’m using the New Universal Login Experience and I’ve read from the documentation that you can specify screen_hint=signup but I’m clueless on how to apply this with the React SDK ("@auth0/auth0-react": “1.3.0”) through loginWithRedirect method.

If someone could help with an example code snippet that’d be much appreciated. Thank you!

Hi @tamntn ,

Unfortunately, the loginWithRedirect method does not currently support custom parameters as far as I can tell. It will only accept those listed here: RedirectLoginOptions | @auth0/auth0-react

You can however specify this (or any other custom querystring parameters) in the Auth0Provider for all your interactive logins:

ReactDOM.render(
  <Auth0Provider
    domain={config.domain}
    clientId={config.clientId}
    audience={config.audience}
    redirectUri={window.location.origin}
    screen_hint="signup"
    onRedirectCallback={onRedirectCallback}
  >
    <App />
  </Auth0Provider>,
  document.getElementById("root")
);
1 Like

Thanks for helping with this one Steve!

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