diff options
author | Julien Dessaux | 2022-10-30 23:16:47 +0100 |
---|---|---|
committer | Julien Dessaux | 2022-10-30 23:16:47 +0100 |
commit | dc5a002144ff7165e73fb38f4be186d827df98c6 (patch) | |
tree | c121abb7e34ae56adb33ca612d5ced962b411b63 /routes/root.js | |
parent | Added a basic database schema and migration function (diff) | |
download | jeux-de-mots-dc5a002144ff7165e73fb38f4be186d827df98c6.tar.gz jeux-de-mots-dc5a002144ff7165e73fb38f4be186d827df98c6.tar.bz2 jeux-de-mots-dc5a002144ff7165e73fb38f4be186d827df98c6.zip |
Added register and login database functions, and use the last one in the login route
Diffstat (limited to 'routes/root.js')
-rw-r--r-- | routes/root.js | 2 |
1 files changed, 1 insertions, 1 deletions
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"); |