app.post('/login', passport.authenticate('local-login', { failureRedirect: '/login'}), function(req, res) { console.log(req.user); req.session.user = req.user; res.redirect('/users'); } );