Hi everyone, I am using managed supertoken core, ...
# support-questions-legacy
b
Hi everyone, I am using managed supertoken core, with email password recipe for React Frontend client side, everything is working fine, but my access token is not getting refreshed with refresh token, once expired.
r
hey @babycobra. does the access token get sent for APIs that are guarded by session verification?
b
Yes
Also wrote a response interceptor, for axios now its working fine, but I beleived this was inbuilt in sdk🥲
r
yea, it is in built
b
but not happening, sadly in my case
r
can you enable frontend debug logs and show me the output when the api returns 401?
b
sure
Its just showing me normal axios error with 401
Copy code
{
  "message": "Request failed with status code 401",
  "name": "AxiosError",
  "config": {
    "transitional": {
      "silentJSONParsing": true,
      "forcedJSONParsing": true,
      "clarifyTimeoutError": false
    },
    "transformRequest": [
      null
    ],
    "transformResponse": [
      null
    ],
    "timeout": 0,
    "xsrfCookieName": "XSRF-TOKEN",
    "xsrfHeaderName": "X-XSRF-TOKEN",
    "maxContentLength": -1,
    "maxBodyLength": -1,
    "env": {
      "FormData": null
    },
    "headers": {
      "Accept": "application/json, text/plain, */*",
      "authorization": "Bearer null",
      "CtxNamespaceKey": "x-namespace",
      "x-namespace": "********"
    },
    "method": "get",
    "params": {},
    "withCredentials": true,
    "url": "https://********:8005/api/v1/workrooms?name="
  },
  "code": "ERR_BAD_REQUEST",
  "status": 401
}
r
what are the request headers?
b
Cookie with access token
and other basic headers + custom headers
r
can i see them?
b
Copy code
:authority:
dev.api.onworkroom.com:8005
:method:
GET
:path:
/api/v1/workrooms?name=
:scheme:
https
Accept:
application/json, text/plain, */*
Accept-Encoding:
gzip, deflate, br
Accept-Language:
en-GB,en-US;q=0.9,en;q=0.8
Authorization:
Bearer null
Cookie:
sAccessToken=eyJraWQiOiJkLTE2OTU4MDAyNjc2MDgiLCJ0eXAiOiJKV1QiLCJ2ZXJzaW9uIjoiNCIsImFsZyI6IlJTMjU2In0.eyJpYXQiOjE2OTU5Njc1NzEsImV4cCI6MTY5NTk2NzU4MSwic3ViIjoiODdhZWRhNTctNTU4MS00ZGQwLWE1ZGEtZTlmMzgxNmRiZTg1IiwidElkIjoicHVibGljIiwic2Vzc2lvbkhhbmRsZSI6IjAyYzkxNjkyLTI4MDAtNGQxOS1hMjI3LWNlN2QxMjdkMjQxZSIsInJlZnJlc2hUb2tlbkhhc2gxIjoiMDFkNmNiZTM2NmE4ZGEwNjk0YjI2MDQ0MGVkYTkyMzdhYWZiODNiOTgxNzkyYzc2NzQ1ODE4ZGM3MTZjMWUzMyIsInBhcmVudFJlZnJlc2hUb2tlbkhhc2gxIjpudWxsLCJhbnRpQ3NyZlRva2VuIjpudWxsLCJpc3MiOiJodHRwOi8vMTQ2LjE5MC4xMC4xMTEvYXV0aCJ9.CL1J2ECE0GUN7pyp2PNIaopO7hqmzTCfjpNZt0UKc2BIFtpSALt6LW6Dt4NRI3A2qIyzEZYoNt_ZOekS2vN91kUzsprNMeS1f5RB14MtoLNJpvcCVZbxVZZ5DVQVseH6oKp5MwSn0Yr-6aoTr8-Wh7AXLDBBlgK7s7YstYNpNGwsM5GRbsI1_22mZ99PIjkN-nSzq2E_O3WrBKc9rwIazElES-enKRnr_jWFpNl8_VZ4d1NiIPAIALyQCGXtZ54aqnWcXY3cNiQXh4vYuPYgL6hfmgsCGX8ikRc_Wv0yvQIZVLlNJ3r-U1Ksao1sAtHgM0ihfIzzR80dAuIoBFlYww
Ctxnamespacekey:
x-namespace
Referer:
http://localhost:3000/
Sec-Ch-Ua:
"Google Chrome";v="117", "Not;A=Brand";v="8", "Chromium";v="117"
Sec-Ch-Ua-Mobile:
?0
Sec-Ch-Ua-Platform:
"macOS"
Sec-Fetch-Dest:
empty
Sec-Fetch-Mode:
cors
Sec-Fetch-Site:
cross-site
User-Agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
X-Namespace:
workroom
r
it seems like our interceptor is not being applied
b
yes
r
can you send me frontend debug logs please?
it's most likely a mis config on your end
b
asin debug logs from sdk?
r
yea..
b
let me see how to enable those
Will these logs help?
r
i think the value that you have set for apiDomain is different from where you are actually querying
the ports are diff
b
yes, my auth service is on 9006 port
and other on 8005
r
yea, thats a known issue. Different ports cause issues with our interceptor logic
you can use sub domains instead if you want.
b
Cool, thanks!
Just needed to be clear about it, I can continue with my custom interceptor for now, until this issue is resolved.
Any place, where I can let this document, for others to be aware of this thing? 🙂
r
you can make an issue about this on our github and once we resolve it, you will know.,
b
Cool!
2 Views