From 54e06aa44a3134dfc42db3e4b473abf5e181fc42 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sat, 19 Nov 2022 18:41:35 +0100 Subject: cleaned up the distinction between routes and controllers --- routes/logout.js | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 routes/logout.js (limited to 'routes/logout.js') diff --git a/routes/logout.js b/routes/logout.js deleted file mode 100644 index a92085a..0000000 --- a/routes/logout.js +++ /dev/null @@ -1,16 +0,0 @@ -import express from "express"; - -import session from "../middlewares/sessions.js"; - -const router = express.Router(); -router.use(session); - -router.get("/", (req, res) => { - if (req.session.user !== undefined) { - res.clearCookie("JDMSessionId"); - req.session.destroy(); - } - return res.redirect(302, "/"); -}); - -export default router; -- cgit v1.2.3