Add "username" to the user object


Iv’e added the ability for users to pick a username during registrations.

When I call user from useAuth0 I don’t get the username back. Is it possible to add this key value pair to the request?

I’d like to dynamically display which user is logged in.

Hi @skossan,

Welcome to the Auth0 Community!

Yes, most definitely. In this scenario, I recommend appending the username as a custom claim to the ID token and calling the getIdTokenClaims property to read these claims on your app.

Please see our this FAQ for more instructions on adding custom claims to tokens.

Please let me know if you have any questions.


1 Like

Thank you. I will investigate this!


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