diff --git a/routes/auth.js b/routes/auth.js index 53242d5..9b400e5 100644 --- a/routes/auth.js +++ b/routes/auth.js @@ -8,6 +8,11 @@ router.get('/login', (req, res, next) => { res.render('accounts/login', { title : "Login" }); }); +router.get('/logout', (req, res, next) => { + req.logout(); + res.redirect("/"); +}); + router.post('/login', passport.authenticate('local', { failureRedirect: '/fail',