https://supertokens.com/ logo
Title
c

Chunkygoo

12/05/2022, 2:07 AM
I'm using NextJS's API routes. The API cannot find the route: http://localhost:3000/api/auth/session/refresh . Do I need to add interceptors? I think the latest version of Supertokens removed the need for adding interceptors right? Using "supertokens-auth-react": "^0.27.3", "supertokens-node": "^12.1.1",
r

rp

12/05/2022, 4:58 AM
Hey
The latest version adds interceptors automatically
Are you getting a 404 status when that api is called? If so, please enable backend debug logs and show the output
c

Chunkygoo

12/05/2022, 6:14 AM
Those two are the latest versions right
Yes, I got a 404 error
r

rp

12/05/2022, 6:20 AM
please show backend debug logs
c

Chunkygoo

12/05/2022, 6:42 AM
com.supertokens {t: "2022-12-05T06:41:48.722Z", message: "getSession: Started", file: "../node_modules/supertokens-node/lib/build/recipe/session/recipeImplementation.js:140:26" sdkVer: "12.1.1"} +0ms com.supertokens {t: "2022-12-05T06:41:48.722Z", message: "getSession: rid in header: true", file: "..node_modules/supertokens-node/lib/build/recipe/session/recipeImplementation.js:141:26" sdkVer: "12.1.1"} +0ms com.supertokens {t: "2022-12-05T06:41:48.722Z", message: "getSession: request method: get", file: "../node_modules/supertokens-node/lib/build/recipe/session/recipeImplementation.js:142:26" sdkVer: "12.1.1"} +0ms com.supertokens {t: "2022-12-05T06:41:48.722Z", message: "getSession: Returning try refresh token because access token from cookies is undefined", file: "../node_modules/supertokens-node/lib/build/recipe/session/recipeImplementation.js:183:34" sdkVer: "12.1.1"} +0ms
r

rp

12/05/2022, 8:04 AM
are you getting a 404 or 401 ? This is a different API that the refresh one.
c

Chunkygoo

12/05/2022, 5:49 PM
As discussed, I will look into the refresh part. Any idea why email verify is receiving a 404?
r

rp

12/06/2022, 2:50 AM
I need to see all the backend debug logs when you call the api.
c

Chunkygoo

12/06/2022, 8:10 AM
The above is what I got
r

rp

12/06/2022, 8:12 AM
What calls the
getSession
function? Are you calling an API that you implemented or is exposed by the middleware?
c

Chunkygoo

12/06/2022, 8:32 AM
The 404 is occuring on the verify email route
r

rp

12/06/2022, 8:34 AM
have you added emailverification.init on the backend?
c

Chunkygoo

12/06/2022, 6:35 PM
That was it. Thank you!