# Update token after updating user info

**URL:** <https://community.auth0.com/t/update-token-after-updating-user-info/87140>\
**Category:** Get Help\
**Tags:** userinfo, user\_metadata, jwt, user-profile\
**Created:** [July 18, 2022, 5:12pm UTC](https://community.auth0.com/t/update-token-after-updating-user-info/87140 "2022-07-18T17:12:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![christina](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/christina/32/33549_2.png) [@christina](https://community.auth0.com/u/christina)\
**Post date:** [July 18, 2022, 5:12pm UTC](https://community.auth0.com/t/update-token-after-updating-user-info/87140/1 "2022-07-18T17:12:11Z")

</div>

When updating the currently logged in user information in our application, we are successfully sending the new information to Auth0, and we can see the user information in the dashboard get updated.  
However, the JWT that is being used still has the old information in it. Is it possible to get the JWT updated automatically when the user info is updated?  
For example, we have a ‘profile’ page, that allows the user to update their name, email, and phone number. The request is successful to the /users/{uuid} endpoint. The token information that is stored in our app in now stale, and is only updated when the user signs out and back in. Can we make a subsequent request to have that updated without user interaction?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 19, 2022, 12:24am UTC](https://community.auth0.com/t/update-token-after-updating-user-info/87140/3 "2022-07-19T00:24:21Z")

</div>

Hey there @christina!

Thanks for the detailed description of your use case.

> [@christina](#):
>
> The token information that is stored in our app in now stale, and is only updated when the user signs out and back in. Can we make a subsequent request to have that updated without user interaction?

It sounds like you might want to look into using [silent authentication](https://auth0.com/docs/authenticate/login/configure-silent-authentication). For example, our spa-js SDK provides a [getTokenSilently](https://auth0.github.io/auth0-spa-js/interfaces/gettokensilentlyoptions.html) method with an option of `ignoreCache` - This will essentially force `getTokenSilently` to make the request to Auth0 even if the current token(s) are still valid.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![christina](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/christina/32/33549_2.png) [@christina](https://community.auth0.com/u/christina)\
**Post date:** [July 20, 2022, 2:34pm UTC](https://community.auth0.com/t/update-token-after-updating-user-info/87140/4 "2022-07-20T14:34:10Z")

</div>

Thank you for the quick response!  
So getAccessTokenSilently makes a call to Auth0 to get a new access token, and then we use that to make a call to /userinfo to get the most up to date user information, yes? Which endpoint does getAccessTokenSilently make a call to? /authorize? If possible, we would prefer to make the call directly instead of using a method.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 21, 2022, 2:25am UTC](https://community.auth0.com/t/update-token-after-updating-user-info/87140/5 "2022-07-21T02:25:20Z")

</div>

No problem!

> [@christina](#):
>
> So getAccessTokenSilently makes a call to Auth0 to get a new access token, and then we use that to make a call to /userinfo to get the most up to date user information, yes? Which endpoint does getAccessTokenSilently make a call to? /authorize?

Correct - It will initiate a call to [/authorize](https://auth0.com/docs/api/authentication#authorize-application) with `prompt=none` parameter. The new token(s) returned should have the updated data. You could also user any non-expired access token to hit `/userinfo` for the updated profile information. For example, if you update the user’s profile info and have an access token/id token from prior to the update, the access token should still work to retrieve the latest info from /userinfo.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [August 5, 2022, 2:26am UTC](https://community.auth0.com/t/update-token-after-updating-user-info/87140/6 "2022-08-05T02:26:02Z")

</div>

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