diff --git a/server.js b/server.js index d1f5ad5..119190a 100644 --- a/server.js +++ b/server.js @@ -75,7 +75,7 @@ app.get('/login', app.post('/login', passport.authenticate('local', { failureRedirect: '/login' }), function(req, res) { - res.redirect('/'); + res.redirect(req.session.returnTo || '/'); }); app.get('/logout',