Do I need to do anything special to make the refresh token work with graphql? signin works just fine, but once the access token expires apollo just errors out. I tried adding an error handler and manually calling SuperTokens.attemptRefreshingSession(), but even then it does not work. Standard get/post requests work just fine. Am I missing something?
n
nkshah2
03/28/2022, 11:24 AM
Hey, do you see any specific network errors?
v
Version467
03/28/2022, 11:26 AM
No. attemptRefreshingSession returns true. It feels like apollo just doesn't use the new cookie. It should be set automatically, right?
Version467
03/28/2022, 11:41 AM
This is just strange. If I put getAccessTokenPayloadSecurely into the graphql error handler, it can get the payload just fine. So clearly the refresh token works, just not for the apollo client.
Version467
03/28/2022, 1:31 PM
I'm losing my mind. If I refresh the token and then fetch a random http endpoint that is guarded, the graphql client will start working again. This narrows the actual source of the error down quite a bit, but I'll figure it out later
n
nkshah2
03/28/2022, 1:33 PM
Can you post some code of how you initialised SuperTokens on the frontend and backend?
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).