Skip to content

Commit

Permalink
#41: Fix redirect bug when logging in
Browse files Browse the repository at this point in the history
Only hit when there is not ?next param
  • Loading branch information
josiahdaniels committed Oct 3, 2013
1 parent 3d79ca8 commit 1169f59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ oApp.configure(function()
{
if (req.session.sUser)
{
res.redirect('/');
res.redirect(oUrl.parse(req.url, true).query.next || '/');
return;
}

Expand Down Expand Up @@ -155,7 +155,7 @@ oApp.configure(function()
if (oUser.checkPassword(req.body.password))
{
req.session.sUser = req.body.username;
res.redirect(sNext);
res.redirect(sNext || '/');
}
else
res.redirect(sErrorUrl);
Expand Down

0 comments on commit 1169f59

Please sign in to comment.