# Using JWT to retrieve and update user profile info

**URL:** <https://community.auth0.com/t/using-jwt-to-retrieve-and-update-user-profile-info/52068>\
**Category:** Get Help\
**Tags:** jwt, express-jwt, api, management-api, auth0\
**Created:** [October 23, 2020, 2:58pm UTC](https://community.auth0.com/t/using-jwt-to-retrieve-and-update-user-profile-info/52068 "2020-10-23T14:58:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rutiglianomassimilia](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rutiglianomassimilia/32/13109_2.png) [@rutiglianomassimilia](https://community.auth0.com/u/rutiglianomassimilia)\
**Post date:** [October 23, 2020, 2:58pm UTC](https://community.auth0.com/t/using-jwt-to-retrieve-and-update-user-profile-info/52068/1 "2020-10-23T14:58:26Z")

</div>

I created a ReactJS web app with a “user profile” page where the logged user can save: name, surname, email and address. For the moment, every time I log-in and save the data a new object is created.

I would like each logged user to be linked to a single ID, namely Auth0 one, so that I can always retrieve and update the row of the right user in my MySQL database.  
I read this [Guide](https://auth0.com/blog/complete-guide-to-react-user-authentication/#Calling-an-API) everything works without problems. Now how can I use JWT to make sure that every row in my database is only retrieved and updated by the right user?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [October 27, 2020, 8:49pm UTC](https://community.auth0.com/t/using-jwt-to-retrieve-and-update-user-profile-info/52068/3 "2020-10-27T20:49:32Z")

</div>

Hi @rutiglianomassimilia,

You can use the `sub` claim (user ID) in the access token to update/retrieve the user’s table.

---

<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:** [November 11, 2020, 8:49pm UTC](https://community.auth0.com/t/using-jwt-to-retrieve-and-update-user-profile-info/52068/4 "2020-11-11T20:49:38Z")

</div>

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