cavalo limao
04/08/2023, 6:07 PMawait NextCors(req, res, {
methods: ["GET", "HEAD", "PUT", "PATCH", "POST", "DELETE"],
origin: https://www.mydomain.com, (It's the same origin)
credentials: true,
allowedHeaders: ["content-type", ...supertokens.getAllCORSHeaders()],
});
export default async function superTokens(req, res) {
await NextCors(req, res, {
methods: ["GET", "HEAD", "PUT", "PATCH", "POST", "DELETE"],
origin: process.env.APP_URL, // https://www.mydomain.com
credentials: true,
allowedHeaders: ["content-type", ...supertokens.getAllCORSHeaders()],
});
await superTokensNextWrapper(
async (next) => {
res.setHeader("Cache-Control", "no-cache, no-store, max-age=0, must-revalidate");
await middleware()(req, res, next);
},
req,
res
);
if (!res.writableEnded) {
res.status(404).send("Not found");
}
}
Could you please tell me where I'm going wrong?
Thank you