techn0will
03/27/2022, 4:59 PMrp_st
03/27/2022, 5:01 PMtechn0will
03/27/2022, 5:02 PMrp_st
03/27/2022, 5:04 PMtechn0will
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_st
03/27/2022, 5:05 PMtechn0will
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_st
03/27/2022, 5:08 PM[object Object]
is?techn0will
03/27/2022, 5:08 PMrp_st
03/27/2022, 5:09 PMawait middleware()(req, res, next);
techn0will
03/27/2022, 5:11 PMrp_st
03/27/2022, 5:11 PMtechn0will
03/27/2022, 5:13 PMrp_st
03/27/2022, 5:13 PMtechn0will
03/27/2022, 5:15 PMphilo9749
03/28/2022, 2:06 PM