We use @auth0/nextjs-auth0 v3 but currently, I see only Login route created and all customers need to click ‘sign up’ link if they want to sign up.
Linking to Login link for new customers looks confusing. Is there anyways for me to have sign up link or direct new customers to signup UI? We are still free version.
Thank you for your help.
Hi @chatriot
Welcome to the Auth0 Community!
Thank you for posting your question. You can have users land directly on the signup page instead of the login page by specifying the screen_hint=signup
parameter when redirecting to /authorize
. You can combine this paramter with prompt=login
to indicate whether you want to always show the authentication page or skip the page if an existing session exists.
There are 2 ways to customize the authorization parameters that will be passed to the /authorize endpoint. The first option is through static configuration when instantiating the client, like so:
export const auth0 = new Auth0Client({
authorizationParameters: {
scope: "openid profile email",
audience: "urn:custom:api"
}
});
The second option is through the query parameters to the /auth/login endpoint which allows you to specify the authorization parameters dynamically. For example, to specify an audience, the login URL would look like so:
<a href="/auth/login?audience=urn:my-api">Login</a>
/authorize parameters | No existing session | Existing session |
---|---|---|
no extra parameters | Shows the login page | Redirects to the callback url |
screen_hint=signup | Shows the signup page | Redirects to the callback url |
prompt=login | Shows the login page | Shows the login page |
prompt=login&screen_hint=signup | Shows the signup page | Shows the signup page |
Thanks
Dawid