From 58a084426bd7faeef83f28ca38791a67839c3a47 Mon Sep 17 00:00:00 2001 From: Milo Schwartz Date: Wed, 5 Feb 2025 22:00:29 -0500 Subject: [PATCH] allow logout to fail --- server/routers/auth/logout.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/routers/auth/logout.ts b/server/routers/auth/logout.ts index a2e0a7f1..db95c2e6 100644 --- a/server/routers/auth/logout.ts +++ b/server/routers/auth/logout.ts @@ -31,7 +31,12 @@ export async function logout( } try { - await invalidateSession(session.sessionId); + try { + await invalidateSession(session.sessionId); + } catch (error) { + logger.error("Failed to invalidate session", error) + } + const isSecure = req.protocol === "https"; res.setHeader("Set-Cookie", createBlankSessionTokenCookie(isSecure));