Skip to content

Commit

Permalink
Redirect to dashboard if returnTo is undefined (user has gone directl…
Browse files Browse the repository at this point in the history
…y to /login/), fixes #77
  • Loading branch information
Matthew McNamara committed Jan 29, 2015
1 parent d7772c7 commit 6454059
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ app.get('/login/auth/twitch',
);

function redirectPostLogin(req, res) {
res.redirect(req.session.returnTo);
var url = req.session.returnTo || '/dashboard';
res.redirect(url);
}

module.exports = app;

0 comments on commit 6454059

Please sign in to comment.