Add logout function

main
sudoer777 2021-11-24 21:07:13 -07:00
parent 8e8f0e3e7c
commit ebef80e061
1 changed files with 5 additions and 0 deletions

View File

@ -8,6 +8,11 @@ router.get('/login', (req, res, next) => {
res.render('accounts/login', { title : "Login" }); res.render('accounts/login', { title : "Login" });
}); });
router.get('/logout', (req, res, next) => {
req.logout();
res.redirect("/");
});
router.post('/login', router.post('/login',
passport.authenticate('local', { passport.authenticate('local', {
failureRedirect: '/fail', failureRedirect: '/fail',