TechnoWill
03/27/2022, 4:59 PMrp
03/27/2022, 5:01 PMTechnoWill
03/27/2022, 5:02 PMrp
03/27/2022, 5:04 PMTechnoWill
03/27/2022, 5:05 PMimport { superTokensNextWrapper } from "supertokens-node/nextjs";
import { middleware } from "supertokens-node/framework/express";
import { NextApiRequest, NextApiResponse } from "next";
import { Request, Response } from "express";
import supertokens from "supertokens-node";
import { backendConfig } from "../../../config/backendConfig";
supertokens.init(backendConfig() as any);
export default async function superTokens(
req: NextApiRequest & Request,
res: NextApiResponse & Response
) {
await superTokensNextWrapper(
async (next) => {
await middleware()(req, res, next);
},
req,
res
);
if (!res.writableEnded) {
res.status(404).send("Not found");
}
}
rp
03/27/2022, 5:05 PMTechnoWill
03/27/2022, 5:07 PMevent - compiled client and server successfully in 586 ms (292 modules)
wait - compiling /auth/[[...path]] (client and server)...
event - compiled client and server successfully in 162 ms (304 modules)
wait - compiling /api/auth/[[...path]]...
event - compiled client and server successfully in 156 ms (320 modules)
error - Error: [object Object]
wait - compiling /_error (client and server)...
event - compiled client and server successfully in 75 ms (321 modules)
error - Error: [object Object]
- for the record does the same logs without the try/catchrp
03/27/2022, 5:08 PM[object Object]
is?TechnoWill
03/27/2022, 5:08 PMrp
03/27/2022, 5:09 PMawait middleware()(req, res, next);
TechnoWill
03/27/2022, 5:11 PMrp
03/27/2022, 5:11 PMTechnoWill
03/27/2022, 5:13 PMrp
03/27/2022, 5:13 PMTechnoWill
03/27/2022, 5:15 PMphilo
03/28/2022, 2:06 PM