Skip to content

Commit a175a04

Browse files
authored
Merge pull request #2562 from rajatmohan22/logoutfix2
Fixes to destroySession
2 parents 42dec8d + dcb2523 commit a175a04

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

server/controllers/session.controller.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ export function destroySession(req, res, next) {
3636
next(err);
3737
return;
3838
}
39-
res.json({ success: true });
39+
req.session.destroy((error) => {
40+
if (error) {
41+
next(error);
42+
return;
43+
}
44+
res.json({ success: true });
45+
});
4046
});
4147
}

0 commit comments

Comments
 (0)