Add logout function
parent
8e8f0e3e7c
commit
ebef80e061
|
@ -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',
|
||||
|
|
Reference in New Issue