# Using Auth0 ID to retrieve and update user info from MySQL

**URL:** <https://community.auth0.com/t/using-auth0-id-to-retrieve-and-update-user-info-from-mysql/51991>\
**Category:** Get Help\
**Tags:** mysql, jwt, api, login, auth0\
**Created:** [October 22, 2020, 12:23pm UTC](https://community.auth0.com/t/using-auth0-id-to-retrieve-and-update-user-info-from-mysql/51991 "2020-10-22T12:23:29Z")\
**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 22, 2020, 12:23pm UTC](https://community.auth0.com/t/using-auth0-id-to-retrieve-and-update-user-info-from-mysql/51991/1 "2020-10-22T12:23:29Z")

</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)

But when I click the buttons to retrieve messages in the API I get:  
_Access to fetch at ‘[http://localhost:8080/api/messages/protected-message](http://localhost:8080/api/messages/protected-message)’ from origin ‘[http://localhost:3000](http://localhost:3000)’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled._

---

<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 28, 2020, 6:32pm UTC](https://community.auth0.com/t/using-auth0-id-to-retrieve-and-update-user-info-from-mysql/51991/2 "2020-10-28T18:32:38Z")

</div>

Answered here:

> [@How to link JWT to my users info database](https://community.auth0.com/t/how-to-link-jwt-to-my-users-info-database/52201):
>
> I have created a web app and use Auth0 for authentication. Each user has his own page with personal data. How can I connect an user logged via Auth0 to my Mysql database in order to retrieve and update his specific data?

---

<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 12, 2020, 6:32pm UTC](https://community.auth0.com/t/using-auth0-id-to-retrieve-and-update-user-info-from-mysql/51991/3 "2020-11-12T18:32:43Z")

</div>

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