Haris Razis
4 years ago
1 changed files with 17 additions and 0 deletions
@ -0,0 +1,17 @@ |
|||
const express = require('express'); |
|||
const router = express.Router(); |
|||
const passport = require('passport') |
|||
|
|||
router.get('/auth/login', passport.authenticate('local', {failureRedirect: '/login'}, |
|||
(req, res) => { |
|||
res.redirect('/'); |
|||
}) |
|||
); |
|||
|
|||
router.get('/auth/logout', (req, res) => { |
|||
req.logout(); |
|||
res.redirect('/login'); |
|||
}); |
|||
|
|||
|
|||
module.exports = router; |
Loading…
Reference in new issue