fix: #7567, allow invite and approval at the same time

This commit is contained in:
Barış Soner Uşaklı
2019-06-04 11:10:20 -04:00
parent a097b19293
commit 4b843ba16f
9 changed files with 49 additions and 20 deletions

View File

@@ -100,7 +100,6 @@ Controllers.login = function (req, res, next) {
var data = {};
var loginStrategies = require('../routes/authentication').getLoginStrategies();
var registrationType = meta.config.registrationType || 'normal';
var allowLoginWith = (meta.config.allowLoginWith || 'username-email');
var returnTo = (req.headers['x-return-to'] || '').replace(nconf.get('base_url') + nconf.get('relative_path'), '');
@@ -117,7 +116,7 @@ Controllers.login = function (req, res, next) {
data.alternate_logins = loginStrategies.length > 0;
data.authentication = loginStrategies;
data.allowRegistration = registrationType === 'normal' || registrationType === 'admin-approval' || registrationType === 'admin-approval-ip';
data.allowRegistration = registrationType === 'normal';
data.allowLoginWith = '[[login:' + allowLoginWith + ']]';
data.breadcrumbs = helpers.buildBreadcrumbs([{
text: '[[global:login]]',
@@ -159,7 +158,7 @@ Controllers.register = function (req, res, next) {
var registrationType = meta.config.registrationType || 'normal';
if (registrationType === 'disabled') {
return next();
return setImmediate(next);
}
var errorText;