question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Route to signup page

See original GitHub issue

Describe the problem you’d like to have solved

I would like to link to the signup page.

Describe the ideal solution

Add an API route /api/auth/signup that redirects. (similar to /api/auth/login)

Alternatives and current work-arounds

Combine the login & signup call-to-action into 1 button.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
orbitelevencommented, Jun 11, 2021

TBH this seems like a normal enough use case that the lib could/should provide it out of the box.

2reactions
adamjmcgrathcommented, May 19, 2021

Hi @thgh - Assuming you’re using the new login experience, you can create your own signup page like so:

Create pages/api/signup.js

import auth0 from '../../lib/auth0';

export default async function signup(req, res) {
  try {
    await auth0.handleLogin(req, res, {
      authorizationParams: {
        screen_hint: 'signup',    // this prompts the signup screen
      },
    });
  } catch (error) {
    console.error(error);
    res.status(error.status || 500).end(error.message);
  }
}

Then link to the signup page:

<a href='/api/signup'>Sign Up</a>

If you’re using the Classic login experience you might want to use a different authorizationParams key and there’s a little more work to do on your custom login page, see: https://community.auth0.com/t/how-do-i-redirect-users-directly-to-the-hosted-signup-page/42520

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building Login / Signup pages with react, react-router and styled
In part 1 we will go through setting up routes with react-router and ... It's so simple that it only has 3 pages,...
Read more >
1 Creating UI for login , signup page and adding Routing
In this video we will create login and signup page for our todo app in react js and firebase#Reactjsconnect with me on -...
Read more >
React Routing and Components for Signup and Login
In this post, we will create a user interface in React for authentication (Signup and Login views). Components will not perform any actions ......
Read more >
How to redirect signin and signup page by react router
So i have a link "create account" in signin page move to signup page ... or navigate to a "/signup" route for the...
Read more >
Creating Backend Routes and User Model for Login and ...
Creating Backend Routes and User Model for Login and Signup in MEAN Stack. Our previous section successfully designed the login and signup page, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found