Signup Link - link straight to signup

Hi,

I am trying to get a link that would guide users straight to the “Sign Up” instead of “Log in”. The problem I am running into is that each signup link has a (what appears to be) unique “state” value. Here is an example:
https://login.gigasheet.com/u/signup?state=hKFo2SBPc2kzLThaVkJ4X2xWQlNVSHFPbkpFR0ZfZWhvTUJhZqFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIE9XWnhWaURDOEVlaDI2MENRUkhCLVVSUmNsR1B6ZGowo2NpZNkgWUF5SDJkRDkxbHlKMTRoV3FJV0hkMEZXYlhxQTZWU3A

Is there a way to somehow standardize this value, or ensure it is the same every time?

Hi @ian.kennedy,

Thanks for reaching out to the Auth0 Community!

I understand that you would like to generate a URL that brings your users to your sign-up page instead of the login page.

To do so, you will need to use the New Universal Login Experience and specify the screen_hint=signup query parameter.

For example:

https://YOUR_DOMAIN/authorize?
    response_type=code&
    client_id=YOUR_CLIENT_ID&
    redirect_uri=https://YOUR_APP/callback&
    scope=SCOPE&
    state=STATE&
    screen_hint=signup

See here to learn more.

Please let me know if you have any questions.

Thank you.

1 Like

How would I do this with passport-auth? (NodeJs/Express)

@rueben.tiow
i use nuxtjs then i try to get the url signup with function:

this.$auth.loginWith('auth0', { params: { action: 'signup', screen_hint: 'signup'} })

it still generate path login:

https://xxxx.us.auth0.com/login?state=xxx&client=xxx&protocol=oauth2&response_type=token&access_type=&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Flogin&scope=openid%20profile%20email&code_challenge_method=&action=signup&screen_hint=signup&audience=https%3A%2F%2Fdev-92n2q07b.us.auth0.com%2Fapi%2Fv2%2F&nonce=I2Ecpk1VZg)
1 Like

Hi @hieunk,

Thank you for reaching out about this issue and my apologies for the late reply.

After looking into your tenant, I noticed that you selected the New Universal Login Experience but also toggled on the Customize Login Page setting. When this setting is enabled, it will override the New Universal Login Experience with the Classic Universal Login Experience.

If you prefer to directly send your users to the signup page using the screen_hint=signup query parameter, you must make sure that you are using the New Univeral Login experience, which includes turning off the Customize Login page toggle.

I hope this helps!

Please let me know if I can help with anything else.

Thanks,
Rueben

If you want a signup link using Express and auth0/express-openid-connect: An Express.js middleware to protect OpenID Connect web applications., here’s how to implement it:

app.get("/signup", (req, res) => {
  res.oidc.login({
    returnTo: "/",
    authorizationParams: { screen_hint: "signup" },
  });
});

Cf How to link directly to Sign-Up · Issue #83 · auth0/express-openid-connect · GitHub

Thanks, the hint signup does the trick, but the “state” value now needs to be dealt with explicitly. What event can I map to in c# to take care of this? Otherwise, invalid state error is shown although all the user bits did work and you can then login successfully.