From 4ea0cc02bc7d10a39cc5093b59cf470069624401 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Thu, 7 Nov 2024 08:10:59 -0500 Subject: [PATCH] fix(server): fix crash when session token returns no data in auth middleware --- server/auth/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/auth/index.ts b/server/auth/index.ts index bafc4c61e..1e03d665e 100644 --- a/server/auth/index.ts +++ b/server/auth/index.ts @@ -69,7 +69,11 @@ export async function authTokenMiddleware( return; } - req.ottsession = await tokens.getSessionInfo(req.token); + try { + req.ottsession = await tokens.getSessionInfo(req.token); + } catch (err) { + log.warn(`Error getting session info in auth middleware: ${err}`); + } if (!req.ottsession) { res.status(401).json({ success: false,