From 5bb234d812746a68718ae4b21cb132a76c012113 Mon Sep 17 00:00:00 2001 From: Josip Igrec Date: Tue, 19 Sep 2023 03:11:28 +0200 Subject: [PATCH] Properly fix trpc context handling --- src/server/api/trpc.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/server/api/trpc.ts b/src/server/api/trpc.ts index f4bd974..809da2d 100644 --- a/src/server/api/trpc.ts +++ b/src/server/api/trpc.ts @@ -59,13 +59,12 @@ export const createServerTRPCContext = async ( | Pick | Pick, ) => { - let user = null; + let session = null; if ("req" in opts && "res" in opts) { const { req, res } = opts; // Get the session from the server using the getServerSession wrapper function - const session = await getServerAuthSession({ req, res }); - user = session?.user; + session = await getServerAuthSession({ req, res }); } return createInnerTRPCContext({