fix: double logout will not result in failures (#2300)

This commit is contained in:
Wyatt Johnson
2019-05-07 22:23:57 +00:00
committed by GitHub
parent ea6f42c256
commit 2b878b224b
@@ -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.