Browse Source

allow logout to fail

Milo Schwartz 5 months ago
parent
commit
58a084426b
1 changed files with 6 additions and 1 deletions
  1. 6 1
      server/routers/auth/logout.ts

+ 6 - 1
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));