mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 18:46:01 +01:00
closes #5156
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user