diff --git a/server/routes/auth.js b/server/routes/auth.js index 70886f0..7e20bf0 100644 --- a/server/routes/auth.js +++ b/server/routes/auth.js @@ -1,17 +1,20 @@ const express = require('express'); -const router = express.Router(); const passport = require('passport') +const router = express.Router(); -router.get('/auth/login', passport.authenticate('local', {failureRedirect: '/login'}, +router.get('/auth/login', passport.authenticate('local'), (req, res) => { - res.redirect('/'); - }) + res.redirect('/dashboard'); + } ); router.get('/auth/logout', (req, res) => { req.logout(); - res.redirect('/login'); + res.redirect('/'); }); +router.get('/auth/current_user', (req, res) => { + res.send(req.user); +}); module.exports = router; diff --git a/server/services/socket.js b/server/services/socket.js index d32ac51..1be7385 100644 --- a/server/services/socket.js +++ b/server/services/socket.js @@ -5,7 +5,6 @@ const {pub, sub} = require('../connections/redis_conn') const {iWrite, closeWrite, iQuery} = require('../actions/influx_actions') module.exports = (server) => { - // noinspection JSValidateTypes const io = socket(server) io.on('connection', socket => {