# Hosted Passwordless with prefill of email address?

**URL:** <https://community.auth0.com/t/hosted-passwordless-with-prefill-of-email-address/14246>\
**Category:** Get Help\
**Tags:** hosted-login-page, passwordless\
**Created:** [August 13, 2018, 11:26am UTC](https://community.auth0.com/t/hosted-passwordless-with-prefill-of-email-address/14246 "2018-08-13T11:26:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![harald.andertun](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/harald.andertun/32/7093_2.png) [@harald.andertun](https://community.auth0.com/u/harald.andertun)\
**Post date:** [August 13, 2018, 11:26am UTC](https://community.auth0.com/t/hosted-passwordless-with-prefill-of-email-address/14246/1 "2018-08-13T11:26:04Z")

</div>

Hi

I have a hosted login page where I allow the user to login/signup with social login or passwordless (email).

I open the login page from AngularJS like this:

```
angularAuth0.authorize({
	allowed_connections: ['linkedin', 'facebook', 'google-oauth2', 'windowslive', 'email'],
	language: lang,
	nonce: getNonce(),
	login_hint: "test@example.com"
});

```

and at the hosted page, I do this:

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

var allowed_connections = config.extraParams.allowed_connections;
var language = config.extraParams.language;
var loginHint = config.extraParams.login_hint;
var prompt = config.prompt;

var lock = new Auth0LockPasswordless(config.clientID, config.auth0Domain, {
      auth: {
        redirectUrl: config.callbackURL,
        responseType: (config.internalOptions || {}).response_type ||
          (config.callbackOnLocationHash ? 'token' : 'code'),
        params: config.internalOptions
      },
      assetsUrl: config.assetsUrl,
      allowedConnections: allowed_connections ? allowed_connections : null,
      rememberLastLogin: !prompt,
      language: language,
      languageDictionary: i18n[language],
      prefill: loginHint ? { email: loginHint, username: loginHint } : null,
      theme: {
        primaryColor: '#4C66AC',
        labeledSubmitButton: false
      },
      closable: false,

      // we want small buttons for social providers
      socialButtonStyle: 'small'
    });

lock.show();

```

**But the email doesn’t get prefilled!**. Is there a mistake in my code, or can the passwordless email field not be prefilled?

---

<div class="post-metadata">

**Author:** ![harald.andertun](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/harald.andertun/32/7093_2.png) [@harald.andertun](https://community.auth0.com/u/harald.andertun)\
**Post date:** [August 13, 2018, 12:02pm UTC](https://community.auth0.com/t/hosted-passwordless-with-prefill-of-email-address/14246/2 "2018-08-13T12:02:39Z")

</div>

# Update

I have installed “Real-time Webtask Logs” and can see the login\_hint is part of the context object… I’t just doesn’t get used in the email field

```
{
  "request": {
    "query": {
      "protocol": "oauth2",
      "client_id": "...",
      "response_type": "token id_token",
      "redirect_uri": "https://.../auth0/callback",
      "scope": "openid email profile user_metadata app_metadata",
      "audience": "https://....eu.auth0.com/userinfo",
      "allowed_connections": [Object],
      "language": "da",
      "nonce": "...",
      "login_hint": "test@example.com",
      "state": "...",
      "auth0Client": "...",
      "verification_code": "632603",
      "_intstate": "deprecated",
      "_csrf": "...",
      "connection": "email",
      "email": "...",
      "popup": false
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![nh43de](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@nh43de](https://community.auth0.com/u/nh43de)\
**Post date:** [September 10, 2018, 11:16pm UTC](https://community.auth0.com/t/hosted-passwordless-with-prefill-of-email-address/14246/3 "2018-09-10T23:16:46Z")

</div>

Any updates to this?

---

<div class="post-metadata">

**Author:** ![harald.andertun](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/harald.andertun/32/7093_2.png) [@harald.andertun](https://community.auth0.com/u/harald.andertun)\
**Post date:** [September 11, 2018, 7:10am UTC](https://community.auth0.com/t/hosted-passwordless-with-prefill-of-email-address/14246/4 "2018-09-11T07:10:19Z")

</div>

No. I’m still waiting for a response from someone who knows if/how this is possible.

---

<div class="post-metadata">

**Author:** ![ajv](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ajv/32/8910_2.png) [@ajv](https://community.auth0.com/u/ajv)\
**Post date:** [October 25, 2018, 7:21am UTC](https://community.auth0.com/t/hosted-passwordless-with-prefill-of-email-address/14246/5 "2018-10-25T07:21:07Z")

</div>

The `prefill` option takes in an object (defining the `username` and/or `email`) - you’re passing in a string. Maybe that’s the culprit?

[https://auth0.com/docs/libraries/lock/v11/configuration#prefill-object-](https://auth0.com/docs/libraries/lock/v11/configuration#prefill-object-)

Edit: Seems that the `prefill` support for Passwordless was added less than a day ago:

> <https://github.com/auth0/lock/blob/master/CHANGELOG.md#v11110-2018-10-23>

> <https://github.com/auth0/lock-passwordless/issues/149#issuecomment-432666649>
>
> is it possible to prefill the email adress when using
> \`this.lock.emailcode(opti…ons, this.\_doAuthentication.bind(this));\`
> 
> By adding \`options.prefill = {email: 'someone@example.com'}\` it does not work.

---

<div class="post-metadata">

**Author:** ![coymartin2018](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@coymartin2018](https://community.auth0.com/u/coymartin2018)\
**Post date:** [October 29, 2018, 2:23pm UTC](https://community.auth0.com/t/hosted-passwordless-with-prefill-of-email-address/14246/6 "2018-10-29T14:23:21Z")

</div>

Don’t know, [https://auth0.com/docs/connections/passwordless/regular-web-app-email-code](https://auth0.com/docs/connections/passwordless/regular-web-app-email-code) [writemyessaytoday](https://writemyessaytoday.net/) seems to cover all the issues.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [August 27, 2019, 1:56pm UTC](https://community.auth0.com/t/hosted-passwordless-with-prefill-of-email-address/14246/7 "2019-08-27T13:56:12Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
