Git Product home page Git Product logo

Comments (11)

danawoodman avatar danawoodman commented on May 18, 2024 10

For those using express-openid-connect, this worked for me (placed after the auth(config) middleware based on @adamjmcgrath's solution above:

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

Key difference: using oidc instead of openid

from express-openid-connect.

adamjmcgrath avatar adamjmcgrath commented on May 18, 2024 1

Hi,

If you're using the new universal login page you can use the screen_hint=signup parameter:
https://auth0.com/docs/universal-login/new#signup

This can be passed through a custom parameter in authorizationParams
https://github.com/auth0/express-openid-connect/blob/master/API.md#authorization-params-key

Feel free to reopen if you need any more info

from express-openid-connect.

JordashTalon avatar JordashTalon commented on May 18, 2024 1

That worked perfect, thanks!

from express-openid-connect.

JordashTalon avatar JordashTalon commented on May 18, 2024 1

Awesome, that's working perfect, thanks!

from express-openid-connect.

JordashTalon avatar JordashTalon commented on May 18, 2024

Ok that worked great, but now /login always goes to sign-up how would I switch the setting based on route?

Example:
/login works like normal
/register sends applies the new authorizationParams and takes them to the signup flow.

from express-openid-connect.

adamjmcgrath avatar adamjmcgrath commented on May 18, 2024

This would probably work (looking at https://github.com/auth0/express-openid-connect/blob/master/lib/context.js#L62)

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

But beware dragons...

from express-openid-connect.

adamjmcgrath avatar adamjmcgrath commented on May 18, 2024

Actually it's in the api so you should be good:
https://github.com/auth0/express-openid-connect/blob/master/API.md#response

from express-openid-connect.

JordashTalon avatar JordashTalon commented on May 18, 2024

Only other thing I need to figure out is how to prefill the email address, is that possible?

from express-openid-connect.

adamjmcgrath avatar adamjmcgrath commented on May 18, 2024

For that you'd need to use the classic universal login (the new one doesn't support pre-filling the email)

In the authorizationParams you'd pass: [email protected] and mode=signUp

You'd also need to customize the classic login screen by adding some logic to handle the mode param:

// retrieve screen mode from extra params if sent; default to 'login'
var mode = config.extraParams.mode || 'login';
...
var lock = new Auth0Lock(config.clientID, config.auth0Domain, {
  // add a selector for which screen to put up 
  initialScreen: mode,
  ...
});

from express-openid-connect.

JordashTalon avatar JordashTalon commented on May 18, 2024

The login_hint is working but I can't figure out where to customize the lock.

Which file do I find this code in?

var lock = new Auth0Lock(...

from express-openid-connect.

adamjmcgrath avatar adamjmcgrath commented on May 18, 2024

In your tenant dashboard: Universal Login > Login > Customize Login Page > Edit the default template

from express-openid-connect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.