Google login got the email name instead of a real nickname, why?

Hi, I have set up auth0 to let users to log in via Google.

And here is the code:

const {
name,
nickname,
picture,
email,
sub,
} = user;

However, the nickname displays the user’s email string before @ sign. For instance:

jackdeti1028@gmail.com

Will display jackdeti1028 to me.

This will expose user’s email and is very ugly on the page.

What can I do?

Thanks

Hi @johnkarl,

Yes, that is by design. Our Normalized User Profile Schema doc states that the nickname is by default, the local part of the user’s email.

An alternative option is use the name instead. That won’t expose the email string before the @ sign.

Would that work for your use case?

Thanks,
Rueben