Auth0 Home Blog Docs

Login vs. Signup in Lock 11, Hosted Pages


#1

Given a Hosted Page (Login) with a URL like this:

https://sgim-prod.auth0.com/login?client=QJsvUQOu6y2vXvpPtkj908SZSld1IUzL&type=signup&redirect=https://sgim.com/auth/auth0/callback

I used to be able to parse type from the config.extraParams, e.g.:

  var config = JSON.parse(decodeURIComponent(escape(window.atob('@@config@@'))));
  config.extraParams = config.extraParams || {};
  var connection = config.connection;
  var prompt = config.prompt;
  var type = config.extraParams.type;

and I would have logic on the page to determine if this was a login page or a signup page, e.g.:

  allowSignUp: type == "login" ? false : true,
  allowLogin: type == "signup" ? false : true,
  languageDictionary: {
    title: type == "signup" ? "Welcome" : "Welcome Back"
  },

Now that config no longer passes type to config.extraParams, how can you make a single Hosted Login Page support both login and signup?

Any help would be greatly appreciated!

Thanks!


#3

:wave: @madasebrof1 I would need to double check but I’m wondering if we could use config.extraParams.initial_screen parameter instead? (so we could do something like initialScreen: this.signedUp ? 'login' : 'signUp'). Provided this parameter is still available, let me see on my end.