From dc5a002144ff7165e73fb38f4be186d827df98c6 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 30 Oct 2022 23:16:47 +0100 Subject: Added register and login database functions, and use the last one in the login route --- routes/root.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'routes/root.js') diff --git a/routes/root.js b/routes/root.js index be3681a..d8e6b55 100644 --- a/routes/root.js +++ b/routes/root.js @@ -5,7 +5,7 @@ import session from "../middlewares/sessions.js"; const router = express.Router(); router.use(session); router.get("/", (req, res) => { - if (session.loggedIn) { + if (req.session.user !== undefined) { return res.redirect(302, "/play"); } return res.redirect(302, "/login"); -- cgit v1.2.3