Hi there! Users metadata update stopped working a ...
# support-questions-legacy
f
Hi there! Users metadata update stopped working a while ago so I'm wondering if we're doing things right. Here is our current flow: 1. Login is done on the client side (with the netlify recipe) 2. A user can update a specific metadata. We have a route that calls
updateUserMetadata
, this works 3. Then client-side, we try to refresh the metadata and it does not work:
Copy code
ts
  const attemptRefreshingSession = await Session.attemptRefreshingSession();
  const sessionExists = await Session.doesSessionExist();
  if (sessionExists) {
    const user_id = await Session.getUserId();
    const accessTokenPayload = await Session.getAccessTokenPayloadSecurely();
accessTokenPayload
contains the same metadata as before. User needs to logout and login again to see the refreshed metadata. What should we do?
Copy code
json
    "supertokens-node": "^13.1.5",
    "supertokens-web-js": "^0.5.0",
r
hey @florian_lefebvre there is no implicit link between the session's access token payload and the user metadata recipe. So updating one does not auto update the other
f
ah makes sense! What's the recommended way of updating the session metadata then? I didn't see it in the docs but I've probably missed it
f
specifically
mergeIntoAccessTokenPayload
right?
r
yup
f
alright thanks a lot!
10 Views