diff --git a/routes/auth.js b/routes/auth.js index 9f4f5bb..b7b8775 100644 --- a/routes/auth.js +++ b/routes/auth.js @@ -88,4 +88,12 @@ router.get('/logout', function (req, res, next) { }); }); +router.get('/admin/logout', function (req, res, next) { + req.logout(function (err) { + if (err) { return next(err); } + if (req.session) { req.session.destroy() } + res.redirect('/'); + }); +}); + module.exports = router; diff --git a/views/admin/dashboard.hbs b/views/admin/dashboard.hbs index 29ae93b..e7785b0 100644 --- a/views/admin/dashboard.hbs +++ b/views/admin/dashboard.hbs @@ -4,7 +4,7 @@