diff options
Diffstat (limited to '')
-rw-r--r-- | controllers/root/logout.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/controllers/root/logout.js b/controllers/root/logout.js new file mode 100644 index 0000000..078df9a --- /dev/null +++ b/controllers/root/logout.js @@ -0,0 +1,7 @@ +export function logout_get(req, res) { + if (req.session.user !== undefined) { + res.clearCookie("JDMSessionId"); + req.session.destroy(); + } + return res.redirect(302, "/"); +} |