diff --git a/server/routes/auth.js b/server/routes/auth.js index e69de29..70886f0 100644 --- a/server/routes/auth.js +++ b/server/routes/auth.js @@ -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;