|
|
|
@ -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;
|
|
|
|
|