After updating user profile, user is logged out when refreshing page

I have an SPA and I am using Auth0 to authenticate users. I use the getTokenSilently method to get the auth0 JWT access token and I then validate it in my custom API and can make requests successfully. I store the accessToken in localStorage, so on every page refresh, the user stays logged in. Now, I have a problem where the user is updating its own profile. The attributes are successfully updated in Auth0, however, when refreshing the page after updating the profile, the user gets logged out and taken back to the login prompt. I have tried to get a new accesstoken and storing it in localStorage right after the update, but that doesn’t seem to work. What are some ways to prevent this?