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