mirror of
https://github.com/kaythomas0/noisedash.git
synced 2025-11-14 04:14:02 +00:00
23 lines
472 B
JavaScript
23 lines
472 B
JavaScript
const express = require('express');
|
|
const passport = require('passport');
|
|
|
|
const router = express.Router();
|
|
|
|
/* GET users listing. */
|
|
router.get('/login', function(req, res, next) {
|
|
res.render('login');
|
|
});
|
|
|
|
router.post('/login/password', passport.authenticate('local', {
|
|
successRedirect: '/',
|
|
failureRedirect: '/login',
|
|
failureMessage: true
|
|
}));
|
|
|
|
router.get('/logout', function(req, res, next) {
|
|
req.logout();
|
|
res.redirect('/');
|
|
});
|
|
|
|
module.exports = router;
|