diff --git a/src/core/server/app/handlers/api/auth/local.ts b/src/core/server/app/handlers/api/auth/local.ts index 874e25c75..55e0c5d3d 100644 --- a/src/core/server/app/handlers/api/auth/local.ts +++ b/src/core/server/app/handlers/api/auth/local.ts @@ -107,9 +107,8 @@ export const logoutHandler = ({ // Get the user on the request. const user = req.user; if (!user) { - return next( - new Error("cannot logout when there is no user on the request") - ); + // If a user is already logged out, then there's no need to do it again! + return res.sendStatus(204); } // Delegate to the logout handler.