Nextjs-auth0: There's no handler for signups

Created on 30 May 2020  路  3Comments  路  Source: auth0/nextjs-auth0

Please do not report security vulnerabilities here. The Responsible Disclosure Program details the procedure for disclosing security issues.

Thank you in advance for helping us to improve this library! Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible. For general support or usage questions, use the Auth0 Community or Auth0 Support. Finally, to avoid duplicates, please search existing Issues before submitting one here.

By submitting an Issue to this repository, you agree to the terms within the Auth0 Code of Conduct.

Description

Provide a clear and concise description of the issue, including what you expected to happen.

Reproduction

Detail the steps taken to reproduce this error, what was expected, and whether this issue can be reproduced consistently or if it is intermittent.

Where applicable, please include:

  • Code sample to reproduce the issue
  • Log files (redact/remove sensitive information)
  • Application settings (redact/remove sensitive information)
  • Screenshots

Environment

Please provide the following:

  • Version of this library used:
  • Version of the platform or framework used, if applicable:
  • Other relevant versions (language, server software, OS, browser):
  • Other modules/plugins/libraries that might be involved:
guidance question

Most helpful comment

a bit late but if you're looking to display the Sign Up page try this:

  1. Create a file 'signup.js' in pages/api/signup.js
import auth0 from '../../lib/auth0';

export default async function signup(req, res) {
  try {
    await auth0.handleLogin(req, res, {
      authParams: {
        screen_hint: 'signup',    // this prompts the signup screen
      },
    });
  } catch (error) {
    console.error(error);
    res.status(error.status || 500).end(error.message);
  }
}
  1. Create a signup button:
<button><a href='/api/signup'>Sign Up</a></button>

All 3 comments

a bit late but if you're looking to display the Sign Up page try this:

  1. Create a file 'signup.js' in pages/api/signup.js
import auth0 from '../../lib/auth0';

export default async function signup(req, res) {
  try {
    await auth0.handleLogin(req, res, {
      authParams: {
        screen_hint: 'signup',    // this prompts the signup screen
      },
    });
  } catch (error) {
    console.error(error);
    res.status(error.status || 500).end(error.message);
  }
}
  1. Create a signup button:
<button><a href='/api/signup'>Sign Up</a></button>

@develanet that is correct, thanks for the guidance here.

v1.0.0 changes authParams to authorizationParams.

Was this page helpful?
0 / 5 - 0 ratings