You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
423 B
20 lines
423 B
const express = require('express');
|
|
const passport = require('passport')
|
|
const router = express.Router();
|
|
|
|
router.get('/auth/login', passport.authenticate('local'),
|
|
(req, res) => {
|
|
res.redirect('/dashboard');
|
|
}
|
|
);
|
|
|
|
router.get('/auth/logout', (req, res) => {
|
|
req.logout();
|
|
res.redirect('/');
|
|
});
|
|
|
|
router.get('/auth/current_user', (req, res) => {
|
|
res.send(req.user);
|
|
});
|
|
|
|
module.exports = router;
|
|
|