Why is the user's full name not displayed when using password-based login?

I am currently using auth0-react to authenticate users for a small web project and have run intoa small issue that I’m not able to figure out.

SDK/Platform info is as follows:

  • SDK Version: e.g. 1.15.0
  • Platform Version: e.g. Node 16.4.1

I’m successfully able to log the user in via redirect (which is perfectly fine), but when I try to display the user’s name via user.name, instead of showing a full name (Given + Family name), it just shows the e-mail address the account is registered under.

Is there a way to change this behavior when using email/password so that it displays their actual name (required at registration for my app, so should always exist) similar to when I login via Google OAuth?

I’d just like it to be consistent, it feels very weird to have different display behaviors based on the method of signup (OAuth vs. not).

Thanks in advance!

Hi @czbaker,

Welcome to the Auth0 Community!

You can Update Root Attributes for Users to anything you would like. This could be done in an Auth0 Actions so it occurs programatically.

Are you collecting a name on signup? By default, the user would not have submitted a name and the email is used in it’s place.

As it turns out, I was actually just logging in using the incorrect user and trying to fetch data.

I had used the base user that I made when I signed up for Auth0 (that didn’t have a given/family name assigned) and wasn’t using the one that DID (that I created via Management API during testing).

It works as it should, I just wasn’t paying attention. Thanks!

1 Like

Glad you figured it out! Thanks for posting an update.

1 Like

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