https://supertokens.com/ logo
#support-questions
Title
# support-questions
a

ashlite

06/18/2022, 4:34 PM
Question I notice in frontend event overide it was using context. and when I inspect it in console there was a userContext object in there. Is that object different than input.userContext in backend? Because when I assign a value there, the frontend context.userContext is empty.
r

rp

06/18/2022, 4:49 PM
Hey! Yea. The userContext object is isolated per API call essentially.
And setting it on the backend doesn’t affect it on the frontend. And vice versa
a

ashlite

06/18/2022, 4:56 PM
owh okay, so the way to pass value from backend and frontend is using accessTokenPayload then?
r

rp

06/18/2022, 4:57 PM
Yea. But that’s nothing to with userContext
a

ashlite

06/18/2022, 5:22 PM
tried adding value to token payload via response from override third party. I check there is session object in the response
Copy code
js
await response.session.updateAccessTokenPayload({
                    userName: userProfile.name,
                    email: response.user.email, 
                    ...currTokenPayload
                  })
But when I call it in the front end, the token payload is empty Is the above instance is different?
r

rp

06/18/2022, 5:31 PM
Hmmm. Can I see the whole code for how you are adding to the payload?
a

ashlite

06/18/2022, 5:35 PM
then in frontend
using NextJs
r

rp

06/18/2022, 5:37 PM
Haha you wrapped the user profile info component in an auth wrapper?
Like ThirdPartyEmailPasswordAuth
a

ashlite

06/18/2022, 5:38 PM
yes
r

rp

06/18/2022, 5:38 PM
Hmm. Then it should reflect
a

ashlite

06/18/2022, 5:39 PM
Copy code
js
export const AuthWrapper = dynamic(
  new Promise((res) => {
    res(ThirdPartyEmailPasswordAuth)
  }),
  {ssr: false}
)
r

rp

06/18/2022, 5:40 PM
Can you print out on the output of useSessionContext()?
Can you print something out on the backend where you call updateAccessTokenPayload? Just to make sure it’s being called?
a

ashlite

06/18/2022, 5:45 PM
okay wait
ahh there is no need, found the problem, some variable call error.
r

rp

06/18/2022, 5:56 PM
Cool!