# I am updating users profile but wont work

**URL:** <https://community.auth0.com/t/i-am-updating-users-profile-but-wont-work/78872>\
**Category:** Get Help\
**Tags:** api, auth0\
**Created:** [February 24, 2022, 4:10pm UTC](https://community.auth0.com/t/i-am-updating-users-profile-but-wont-work/78872 "2022-02-24T16:10:46Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![pandeysumit832](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pandeysumit832/32/24787_2.png) [@pandeysumit832](https://community.auth0.com/u/pandeysumit832)\
**Post date:** [February 24, 2022, 4:10pm UTC](https://community.auth0.com/t/i-am-updating-users-profile-but-wont-work/78872/1 "2022-02-24T16:10:46Z")

</div>

I am using react SDK and using useAth0 hook to fetch user. When I am trying to update a user’s profile using management API (getAccessTokenSilently) I receive a success message but the useAuth0 hook returns me old user’s data (nickname) and if I try logging in again it gives me an updated nickname.

---

<div class="post-metadata">

**Author:** ![sgo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sgo/32/13789_2.png) [@sgo](https://community.auth0.com/u/sgo)\
**Post date:** [March 1, 2022, 12:10pm UTC](https://community.auth0.com/t/i-am-updating-users-profile-but-wont-work/78872/3 "2022-03-01T12:10:46Z")

</div>

Hi @pandeysumit832 ,

This is likely due to the ID token that has been cached being used for the user profile object.

You could call the getAccessTokenSilently with the option `ignoreCache=true` to ensure Auth0 fetches the latest object after a change rather than referring to what it has cached.

- [https://auth0.github.io/auth0-react/interfaces/index.gettokensilentlyoptions.html#ignorecache](https://auth0.github.io/auth0-react/interfaces/index.gettokensilentlyoptions.html#ignorecache)

---

<div class="post-metadata">

**Author:** ![pandeysumit832](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pandeysumit832/32/24787_2.png) [@pandeysumit832](https://community.auth0.com/u/pandeysumit832)\
**Post date:** [March 3, 2022, 6:52am UTC](https://community.auth0.com/t/i-am-updating-users-profile-but-wont-work/78872/5 "2022-03-03T06:52:26Z")

</div>

Thank you so much for reverting back to me. I also have one more question for you can we do the same with the management API patch request?

---

<div class="post-metadata">

**Author:** ![sgo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sgo/32/13789_2.png) [@sgo](https://community.auth0.com/u/sgo)\
**Post date:** [March 4, 2022, 3:46pm UTC](https://community.auth0.com/t/i-am-updating-users-profile-but-wont-work/78872/6 "2022-03-04T15:46:31Z")

</div>

Hi @pandeysumit832 ,

You can patch a user via this endpoint:

- [Patch User](https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id)

And you can search for a user, or GET a user via their ID using the following endpoints, respecitvely:

- [Search for user](https://auth0.com/docs/api/management/v2#!/Users/get_users)
- [Get user by ID](https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id)

When looking for updates on a user via the Management API, please note that some requests are more immediate than others in reflecting changes:

- [Search for Users](https://auth0.com/docs/manage-users/user-search)
- [Retrieve Users with the Get Users Endpoint](https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint)
- [Retrieve Users with Get Users by Email Endpoint](https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-by-email-endpoint)
- [Retrieve Users with the Get Users by ID Endpoint](https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-by-id-endpoint)

---

<div class="post-metadata">

**Author:** ![Keanu](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/keanu/32/33313_2.png) [@Keanu](https://community.auth0.com/u/Keanu)\
**Post date:** [March 7, 2022, 5:38am UTC](https://community.auth0.com/t/i-am-updating-users-profile-but-wont-work/78872/7 "2022-03-07T05:38:30Z")

</div>

> [@sgo](#):
>
> This is likely due to the ID token that has been cached being used for the user profile object.
> 
> You could call the getAccessTokenSilently with the option `ignoreCache=true` to ensure Auth0 fetches the latest object after a change rather than referring to what it has cached[.](https://www.mybalancenow.tips/)

I was suffering from this issue since 5 days thanks for sharing it.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 7, 2022, 8:17am UTC](https://community.auth0.com/t/i-am-updating-users-profile-but-wont-work/78872/8 "2022-03-07T08:17:58Z")

</div>

No worries, we’re here for you!

---

<div class="post-metadata">

**Author:** ![pandeysumit832](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pandeysumit832/32/24787_2.png) [@pandeysumit832](https://community.auth0.com/u/pandeysumit832)\
**Post date:** [March 7, 2022, 11:19am UTC](https://community.auth0.com/t/i-am-updating-users-profile-but-wont-work/78872/9 "2022-03-07T11:19:37Z")

</div>

We have tried this solution but I am afraid it’s not working for us. Since we have used cacheLoaction = “localstorage” in our Auth0Provider. Can you help us with that?

---

<div class="post-metadata">

**Author:** ![sgo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sgo/32/13789_2.png) [@sgo](https://community.auth0.com/u/sgo)\
**Post date:** [March 7, 2022, 4:06pm UTC](https://community.auth0.com/t/i-am-updating-users-profile-but-wont-work/78872/10 "2022-03-07T16:06:32Z")

</div>

Hi @pandeysumit832 , you should be able to use the ignoreCache option on the getAccessTokenSilently call itself for when you need to ensure you have the most up to date version of the user profile, this wouldn’t be set at the Auth0Provider level.

---

<div class="post-metadata">

**Author:** ![pandeysumit832](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pandeysumit832/32/24787_2.png) [@pandeysumit832](https://community.auth0.com/u/pandeysumit832)\
**Post date:** [March 7, 2022, 6:28pm UTC](https://community.auth0.com/t/i-am-updating-users-profile-but-wont-work/78872/11 "2022-03-07T18:28:16Z")

</div>

I m sorry i didn’t get it

---

<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:** [March 22, 2022, 6:28pm UTC](https://community.auth0.com/t/i-am-updating-users-profile-but-wont-work/78872/12 "2022-03-22T18:28:30Z")

</div>

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