supertokens.Error.TRY_REFRESH_TOKEN
Type: {errType: supertokens.Error.TRY_REFRESH_TOKEN, err: any}
- The err object inside the thrown error will be the actual error generated by whatever caused this error.
- This error is thrown when:
- Access token validation failed.
- CSRF token validation failed. (If enable_anti_csrf in the config object is set to true)
- The way to handle this error is to NOT clear the cookies and send a session expired status code to your frontend.
- If you are building a website and get this error for a GET API that returns HTML, then you should reply with HTML & JS that calls your refresh session endpoint. Once that is successful, your frontend code should redirect the browser to call again the original GET API.
- This is an
enum
and thenumber
value of this (as seen on the console) is3000
We recommend you to use one of our frontend SDK which will take care of calling your refresh token API for you.