https://supertokens.com/ logo
e

EdwinN1337

05/30/2022, 2:58 PM
Sorry, i don't need to refreshUser, i need to re-run my
createNewSession
logic... to add hasura claims Anyway we can do this?
r

rp

05/30/2022, 3:01 PM
Hey!
Ah right. Yea. You can make your own api and call that from the frontend. That api does session verification first and then updates the access token payload
There is a session.updateAccessTokenPayload function available for that on the backend (the session object retrieved from session verification)
e

EdwinN1337

05/30/2022, 3:18 PM
ahh ye right! got it
thanks again haha 😄
Hey, sorry for disturbing again
somehow I can this error wile using
session.updateAccessTokenPayload
r

rp

05/31/2022, 8:52 AM
hey!
e

EdwinN1337

05/31/2022, 8:52 AM
session.updateAccessTokenPayload(newSessionPayload, {})
calling the function like this newSessionPayload is what u see in the log ( the hasura claims)
r

rp

05/31/2022, 8:54 AM
you need to add an
await
in front
e

EdwinN1337

05/31/2022, 8:55 AM
lol, i thought i tried it alrdy
r

rp

05/31/2022, 8:55 AM
lmk if that solves your issue
e

EdwinN1337

05/31/2022, 8:58 AM
thanks 🙂 yeah it does
got everything working now > email/password & social with custom UI
gonna move to capacitor now, this will probably be hard due to creating own interceptor
might have some more questions, but when i finish i'll probably write small blog how to do next.js / capacitor cross platform app with supertokens auth 😉
r

rp

05/31/2022, 9:09 AM
awesome! You don't need to write your own interceptor
You can use our frontend SDK which will provide you with the interceptors
you just have to give it a custom cookie and window handler that works with capacitor
3 Views