# Login vs. Signup in Lock 11, Hosted Pages

**URL:** <https://community.auth0.com/t/login-vs-signup-in-lock-11-hosted-pages/10947>\
**Category:** Get Help\
**Created:** [April 17, 2018, 4:11pm UTC](https://community.auth0.com/t/login-vs-signup-in-lock-11-hosted-pages/10947 "2018-04-17T16:11:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![madasebrof1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@madasebrof1](https://community.auth0.com/u/madasebrof1)\
**Post date:** [April 17, 2018, 4:11pm UTC](https://community.auth0.com/t/login-vs-signup-in-lock-11-hosted-pages/10947/1 "2018-04-17T16:11:48Z")

</div>

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

> **[Sign In with Auth0](https://sgim-prod.auth0.com/login?client=QJsvUQOu6y2vXvpPtkj908SZSld1IUzL&type=signup&redirect=https:%2F%2Fsgim.com%2Fauth%2Fauth0%2Fcallback)**

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

```auto
  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.:

```auto
  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!

---

<div class="post-metadata">

**Author:** ![kimcodes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kimcodes/32/81052_2.png) [@kimcodes](https://community.auth0.com/u/kimcodes)\
**Post date:** [April 17, 2018, 7:52pm UTC](https://community.auth0.com/t/login-vs-signup-in-lock-11-hosted-pages/10947/3 "2018-04-17T19:52:46Z")

</div>

👋 @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.

---

<div class="post-metadata">

**Author:** ![madasebrof1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@madasebrof1](https://community.auth0.com/u/madasebrof1)\
**Post date:** [April 30, 2018, 6:00pm UTC](https://community.auth0.com/t/login-vs-signup-in-lock-11-hosted-pages/10947/4 "2018-04-30T18:00:29Z")

</div>

@kimcodes thanks for getting back to me!

Yeah, it looks like that is no longer available. When I inspect `config.extraParams` I only see:

```auto
clientID
tenant
redirect

```

I am open to any other solution.

Basically, I just need to be able to make two paths: one for users that want to login, and a second path for users that want to create a new account, e.g. I have two buttons: “SIGNUP” and “LOGIN”.

(Seem like a pretty standard concept!)

It looks like I can only create a single “login” hosted page under Auth0, so I can’t figure out how to accomplish this.

Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![sgmeyer](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sgmeyer/32/3387_2.png) [@sgmeyer](https://community.auth0.com/u/sgmeyer)\
**Post date:** [May 1, 2018, 1:49pm UTC](https://community.auth0.com/t/login-vs-signup-in-lock-11-hosted-pages/10947/5 "2018-05-01T13:49:34Z")

</div>

Hey there, Kim’s approach could work with a simple tweak. Instead of using `initial_screen` you could use `login_hint`. The difference is `login_hint` is defined in the OIDC specification and shouldn’t be filtered by Auth0. This means instead of using a custom get parameter you could use something defined in the specification:

> **[Final: OpenID Connect Core 1.0 incorporating errata set 1](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest)**
>
> OpenID Connect Core 1.0 incorporating errata set 1

---

<div class="post-metadata">

**Author:** ![madasebrof1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@madasebrof1](https://community.auth0.com/u/madasebrof1)\
**Post date:** [May 2, 2018, 8:37pm UTC](https://community.auth0.com/t/login-vs-signup-in-lock-11-hosted-pages/10947/6 "2018-05-02T20:37:07Z")

</div>

@sgmeyer Awesome, are there any code examples of using something from the OIDC spec with Lock 11 and a hosted login page?

---

<div class="post-metadata">

**Author:** ![sgmeyer](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sgmeyer/32/3387_2.png) [@sgmeyer](https://community.auth0.com/u/sgmeyer)\
**Post date:** [May 2, 2018, 9:23pm UTC](https://community.auth0.com/t/login-vs-signup-in-lock-11-hosted-pages/10947/7 "2018-05-02T21:23:24Z")

</div>

@madasebrof1 I don’t know of any examples, but it is quite easy. Using my own client I created the authorize link:

```auto
https://tore.auth0.com/authorize?client_id=e0rl3mb8ioNtDMe8cjFEl0aeCM04Iyzw&response_type=code&redirect_uri=https://jwt.io&login_hint=signUp

```

Notice the last get parameter is `login_hint=signUp`. This login his is guranteed to be passed to the login page and is done so with `config.extraParams.login_hint`. Lock, by default uses this for email and phone number pre-fill. Instead of using it for pre fill I am going to follow @kimcodes’s approach for `initial-screen`. This is a lock option that can be set to `signUp`, `login`, or `forgotPassword`. Here is an example of my lock configuration:

```auto
<script>
    // Decode utf8 characters properly
    var config = JSON.parse(decodeURIComponent(escape(window.atob('@@config@@'))));
    config.extraParams = config.extraParams || {};
    var connection = config.connection;
    var prompt = config.prompt;
    var languageDictionary;
    var language;
    var hint = config.extraParams.login_hint
    
    if (config.dict && config.dict.signin && config.dict.signin.title) {
      languageDictionary = { title: config.dict.signin.title };
    } else if (typeof config.dict === 'string') {
      language = config.dict;
    }
    
    var lock = new Auth0Lock(config.clientID, config.auth0Domain, {
      auth: {
        redirectUrl: config.callbackURL,
        responseType: (config.internalOptions || {}).response_type ||
          (config.callbackOnLocationHash ? 'token' : 'code'),
        params: config.internalOptions
      },
      assetsUrl: config.assetsUrl,
      initialScreen: config.extraParams.login_hint,
      allowedConnections: connection ? [connection] : null,
      rememberLastLogin: !prompt,
      language: language,
      languageDictionary: languageDictionary,
      theme: {
        //logo: 'YOUR LOGO HERE',
        //primaryColor: 'green'
      },
      closable: false,
      defaultADUsernameFromEmailPrefix: false,
      // uncomment if you want small buttons for social providers
      // socialButtonStyle: 'small'
    });

    lock.show();
  </script>

```

---

<div class="post-metadata">

**Author:** ![madasebrof1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@madasebrof1](https://community.auth0.com/u/madasebrof1)\
**Post date:** [May 2, 2018, 10:37pm UTC](https://community.auth0.com/t/login-vs-signup-in-lock-11-hosted-pages/10947/8 "2018-05-02T22:37:53Z")

</div>

Epic, thanks.

I’d think this would be good to add to the docs, as I imagine this would be a very common use case.

---

<div class="post-metadata">

**Author:** ![sgmeyer](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sgmeyer/32/3387_2.png) [@sgmeyer](https://community.auth0.com/u/sgmeyer)\
**Post date:** [May 3, 2018, 10:25am UTC](https://community.auth0.com/t/login-vs-signup-in-lock-11-hosted-pages/10947/9 "2018-05-03T10:25:40Z")

</div>

@madasebrof1 thanks for the docs idea. I am definitely going to put a doc request in for this. Also, if you could mark the right answer that would be huge.

---

<div class="post-metadata">

**Author:** ![madasebrof1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@madasebrof1](https://community.auth0.com/u/madasebrof1)\
**Post date:** [May 3, 2018, 1:00pm UTC](https://community.auth0.com/t/login-vs-signup-in-lock-11-hosted-pages/10947/10 "2018-05-03T13:00:41Z")

</div>

@sgmeyer @kimcodes

I marked this as solved, by there is one problem. I am using `Auth0LockPasswordless`, not `Auth0Lock`, which seems to ignore `initialScreen: config.extraParams.login_hint`.

It only shows up as ‘LOGIN IN WITH GOOGLE’, etc. instead of ‘SIGNUP WITH GOOGLE’

I am now able to change the message so it’s not totally confusing, but it isn’t ideal.

See what I mean:

[https://sgim-prod.auth0.com/login?client=QJsvUQOu6y2vXvpPtkj908SZSld1IUzL&redirect=https://sgim.com/auth/auth0/callback&login\_hint=signUp](https://sgim-prod.auth0.com/login?client=QJsvUQOu6y2vXvpPtkj908SZSld1IUzL&redirect=https://sgim.com/auth/auth0/callback&login_hint=signUp)

I feel like this use case isn’t thought through, e.g. using a combination of `Passwordless` AND allowing the ability to login/signup via google, etc.

If you could pass this to the dev team (or if you are the dev team!) that would be great.

---

<div class="post-metadata">

**Author:** ![sgmeyer](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sgmeyer/32/3387_2.png) [@sgmeyer](https://community.auth0.com/u/sgmeyer)\
**Post date:** [May 3, 2018, 1:26pm UTC](https://community.auth0.com/t/login-vs-signup-in-lock-11-hosted-pages/10947/11 "2018-05-03T13:26:24Z")

</div>

@madasebrof1 ah sorry I had assumed you were using Lock instead of PasswordlessLock. when using big social buttons the `Login with` text is actually hardcoded into the SDK. Here is the bit of code in the repo:

> <https://github.com/auth0/lock-passwordless/blob/master/src/cred/social/social_button.jsx#L24>

I think, and to your point, it would be nice for this to be exposed in the dictionary so you could change this. I’ll pass along your use case to the team. Thanks for the feedback!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 17, 2018, 11:07am UTC](https://community.auth0.com/t/login-vs-signup-in-lock-11-hosted-pages/10947/12 "2018-12-17T11:07:51Z")

</div>


