This commit is contained in:
Julian Lam
2016-10-25 16:52:03 -04:00
parent e515b791da
commit 0590a4f2cf
4 changed files with 8 additions and 20 deletions

View File

@@ -104,6 +104,7 @@ Controllers.login = function (req, res, next) {
var registrationType = meta.config.registrationType || 'normal';
var allowLoginWith = (meta.config.allowLoginWith || 'username-email');
var returnTo = req.headers['x-return-to'].replace(nconf.get('url'), '');
var errorText;
if (req.query.error === 'csrf-invalid') {
@@ -112,6 +113,10 @@ Controllers.login = function (req, res, next) {
errorText = validator.escape(String(req.query.error));
}
if (returnTo) {
req.session.returnTo = returnTo;
}
data.alternate_logins = loginStrategies.length > 0;
data.authentication = loginStrategies;
data.allowLocalLogin = parseInt(meta.config.allowLocalLogin, 10) === 1 || parseInt(req.query.local, 10) === 1;