https://supertokens.com/ logo
adding info to access token payload
f

FoolOnTheHill

04/12/2023, 7:17 PM
I just want to show the user name (or any of their details) on the frontend but useSessionContext returns nothing of use except the user's ID. I followed the setup guide exactly and I'm using the code from "fetching on the frontend" but accessTokenPayload is empty.
r

rp

04/12/2023, 7:21 PM
By default, the access token payload is empty. You need to add whatever info you want in it on the backend by overriding the createNewSession function: https://supertokens.com/docs/session/common-customizations/sessions/claims/access-token-payload
f

FoolOnTheHill

04/12/2023, 7:34 PM
I did try that tutorial but it didn't do anything when added to my backendConfig. Thanks for answering, I'll try again