Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to send user directly to signup page on login #471

Closed
jonkcinema opened this issue Aug 22, 2021 · 4 comments
Closed

Add ability to send user directly to signup page on login #471

jonkcinema opened this issue Aug 22, 2021 · 4 comments

Comments

@jonkcinema
Copy link

jonkcinema commented Aug 22, 2021

Describe the problem you'd like to have solved

Most webapps have some sort of "create account" button. The auth0-react library supports this via the screen_hint parameter:

loginWithRedirect({ screen_hint: 'signup' })

The nextjs-auth0 library does not appear to support this.

Describe the ideal solution

Please add a way to send the user directly to the signup page.

E.g. <a href="/api/auth/login?screenHint=signup">Sign up</a>

Alternatives and current work-arounds

You can create your own signup handler (e.g. pages/api/signup.js), but that seems pretty unfortunate given how simple and common of an operation this is.

@adamjmcgrath
Copy link
Contributor

Hi @jonkcinema - thanks for raising this

How you do signup depends on which Universal Login Page you are using see https://community.auth0.com/t/how-do-i-redirect-users-directly-to-the-hosted-signup-page/42520 for more information

Because there are different APIs for the new Universal Login experience and the Classic one (there is actually no specific API for the classic experience), and there is no way for the SDK to know which Login experience your tenant is set to - it's not possible to provide a signup api in the SDK. You'll need to create one yourself as you've described in the workaround.

@jonkcinema
Copy link
Author

jonkcinema commented Aug 23, 2021 via email

@adamjmcgrath
Copy link
Contributor

Hi @jonkcinema

The implimentation of auth0-react and this SDK are very similar and they both have the same constraints regarding the Classic and New Universal Login Pages:

// auth0-react
loginWithRedirect({ screen_hint: 'signup' })

// nextjs-auth0
handleLogin(req, res, { authorizationParams: { screen_hint: 'signup' }});

@jonkcinema
Copy link
Author

jonkcinema commented Aug 23, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants