@rp_st
this is my code
I referred to the following
https://supertokens.com/docs/thirdparty/nextjs/session-verification/in-api
export default async function userFunk(req: any, res: any) {
await NextCors(req, res, {
methods: ['GET', 'HEAD', 'PUT', 'PATCH', 'POST', 'DELETE'],
origin: process.env.NEXT_PUBLIC_DOMAIN_ROOT,
credentials: true,
allowedHeaders: ['content-type', ...supertokens.getAllCORSHeaders()],
});
let err = null;
await superTokensNextWrapper(
async (next) => {
err = await verifySession()(req, res, next);
return err;
},
req,
res,
);
console.log('err', err);
if (err) {
return res.json({
status: 'failed',
});
}
return res.json({
status: 'success',
});
}