<@498057949541826571> When the access token expir...
# support-questions-legacy
p
@rp_st When the access token expires the app says unauthorized and even i try for login route it says unauthorized. Am i missing something here ?
r
hey @porcx
"even i try for login route" -> can you be more specific? Also, maybe search discord to see other session related issues and try debugging it before i can help 🙂
p
@rp_st I am using supertokens with fastify. From postman when i log in i get response and it sets accesstoken, refresh token in cookies. When the access token get's expired and when i log in again from postman it works. But from my app when the access token is expired and i try to login again from the app it says try refresh token Unauthorized. I went through the documentation and even i added this like still no success fastify.addHook("preHandler", verifySession({ sessionRequired: false })); My question is from postman it works as expected even though the token expires i still can send request and log in but from app when the token expires i cannot login it says the try refresh token unauthorized
@rp_st okay i tried debugging. Every time i try to login in headers it adds rid (reciepe id) and when rid is there with the expired token it says try refresh token and when i remove that rid then i can sign in.
r
when the access token expires, our frontend SDK should do a session refresh - is that not happening?
p
Nope even for the /refresh it says try refresh token 401 Unauthorized
r
huh.. thats weird. Can i see the response and request headers for the refresh API call? There is probably some config error somewhere
p
Copy code
Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Connection: keep-alive
Content-Length: 98
Content-Type: application/json
Cookie: sIdRefreshToken=265e487b-a473-419c-9068-f646b091de66; sIRTFrontend=remove
Host: admin.playbook.test
Origin: http://admin.playbook.test
Referer: http://admin.playbook.test/login
rid: anti-csrf
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Response
Copy code
{
  "message": "try refresh token"
}
This was for sign in now for refresh
Copy code
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Connection: keep-alive
Content-Length: 0
fdi-version: 1.8,1.9,1.10,1.11,1.12,1.13
Host: admin.playbook.test
Origin: http://admin.playbook.test
Referer: http://admin.playbook.test/login
rid: session
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Response
Copy code
{
  "message": "Route POST:/session/refresh not found",
  "error": "Not Found",
  "statusCode": 404
}
r
it says not found error
please make sure that your apiDomain, apiBasePath are correctly set on the backend and frontend
see other threads on discord first please
2 Views