# Logging in with email doesn't populate email, it populates name

**URL:** <https://community.auth0.com/t/logging-in-with-email-doesnt-populate-email-it-populates-name/76037>\
**Category:** Get Help\
**Tags:** oauth2\
**Created:** [January 8, 2022, 12:47pm UTC](https://community.auth0.com/t/logging-in-with-email-doesnt-populate-email-it-populates-name/76037 "2022-01-08T12:47:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![john25](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john25/32/34278_2.png) [@john25](https://community.auth0.com/u/john25)\
**Post date:** [January 8, 2022, 12:47pm UTC](https://community.auth0.com/t/logging-in-with-email-doesnt-populate-email-it-populates-name/76037/1 "2022-01-08T12:47:17Z")

</div>

I’m creating new users using very basic oath2 flow from a rails app. I sign up using email address, and log in fine. I get verification emails. However, the data Auth0 sends to me with the token shows the email in the name field and the email field is blank On first glance, this seems like a bug. Maybe there is some nuance I am missing?

```auto
{
       "provider" => "auth0",
            "uid" => "auth0|61d98528cbxxx",
           "info" => {
            "name" => "tester123@xxx.com",
        "nickname" => "tester123",
           "email" => nil,
           "image" => "https://s.gravatar.com/avatar/xxx?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fte.png"
    },
    "credentials" => {
                "token" => "eyJhbGcixxx",
           "expires_at" => 1641731795,
              "expires" => true,
             "id_token" => "eyxxx",
           "token_type" => "Bearer",
        "refresh_token" => nil
    },
          "extra" => {
        "raw_info" => {
              "nickname" => "tester123",
                  "name" => "tester123@xxx.com",
               "picture" => "https://s.gravatar.com/avatar/xxx?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fte.png",
            "updated_at" => "2022-01-08T12:35:52.634Z",
                   "iss" => "https://dev-xxx.us.auth0.com/",
                   "sub" => "auth0|61d98528cb5b3exxx",
                   "aud" => "nC2lO76sdxU3mZkBlD0xxx",
                   "iat" => 1641645395,
                   "exp" => 1641681395,
                 "nonce" => "744f45bc354023ac452xxx"
        }
    }
}
{
        "name" => "tester123@xxx.com",
    "nickname" => "tester123",
       "email" => nil,
       "image" => "https://s.gravatar.com/avatar/xxx?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fte.png"
}

```

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [January 14, 2022, 7:04pm UTC](https://community.auth0.com/t/logging-in-with-email-doesnt-populate-email-it-populates-name/76037/3 "2022-01-14T19:04:27Z")

</div>

Hi @john25,

Thanks for reaching out to the Auth0 Community!

I understand that you’ve observed a scenario where the token you inspect does not have the email in the token and the name property is populated with the email address.

First, to get the _email_ attribute in the token, you will need to specify the `email` scope in your `/authorize` request. See [this](https://auth0.com/docs/get-started/apis/scopes/openid-connect-scopes#standard-claims) doc for extra details.

Then, to populate the _name_ field with something other than the email address, you must allow the user to specify this attribute on sign up. To do so, you will need to use the [_additionalSignupFields_](https://auth0.com/docs/libraries/lock/lock-configuration#additionalsignupfields-array-) in your Universal Login Page.

Once you have done so, you will see the email and name in the token populated correctly.

Please let me know if you have any questions.

Thanks!

---

<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:** [January 29, 2022, 7:04pm UTC](https://community.auth0.com/t/logging-in-with-email-doesnt-populate-email-it-populates-name/76037/4 "2022-01-29T19:04:39Z")

</div>

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