mirror of
https://github.com/wassname/talk.git
synced 2026-07-28 11:27:05 +08:00
fix: double logout will not result in failures (#2300)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user