I'm using NextJS's API routes. The API cannot find...
# support-questions-legacy
c
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
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
Those two are the latest versions right
Yes, I got a 404 error
r
please show backend debug logs
c
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
are you getting a 404 or 401 ? This is a different API that the refresh one.
c
As discussed, I will look into the refresh part. Any idea why email verify is receiving a 404?
r
I need to see all the backend debug logs when you call the api.
c
The above is what I got
r
What calls the
getSession
function? Are you calling an API that you implemented or is exposed by the middleware?
c
The 404 is occuring on the verify email route
r
have you added emailverification.init on the backend?
c
That was it. Thank you!
98 Views