Fix age old bug with /login redirecting to /register after registration

This commit is contained in:
Calvin Montgomery 2016-10-01 21:31:04 -07:00
parent c88c63a422
commit 35a8e2b52a
2 changed files with 8 additions and 4 deletions

View File

@ -2,7 +2,7 @@
"author": "Calvin Montgomery", "author": "Calvin Montgomery",
"name": "CyTube", "name": "CyTube",
"description": "Online media synchronizer and chat", "description": "Online media synchronizer and chat",
"version": "3.22.3", "version": "3.22.4",
"repository": { "repository": {
"url": "http://github.com/calzoneman/sync" "url": "http://github.com/calzoneman/sync"
}, },

View File

@ -113,9 +113,13 @@ function handleLoginPage(req, res) {
}); });
} }
sendPug(res, "login", { var redirect = req.query.dest || req.header("referer");
redirect: req.query.dest || req.header("referer") var locals = {};
}); if (!/\/register/.test(redirect)) {
locals.redirect = redirect;
}
sendPug(res, "login", locals);
} }
/** /**