Disable ldap/directory config/2fa in demo mode
This commit is contained in:
@@ -660,6 +660,8 @@ function setTwoFactorAuthenticationSecret(userId, callback) {
|
||||
userdb.get(userId, function (error, result) {
|
||||
if (error) return callback(error);
|
||||
|
||||
if (settings.isDemo() && result.username === constants.DEMO_USERNAME) return callback(new BoxError(BoxError.BAD_FIELD, 'Not allowed in demo mode'));
|
||||
|
||||
if (result.twoFactorAuthenticationEnabled) return callback(new BoxError(BoxError.ALREADY_EXISTS));
|
||||
|
||||
var secret = speakeasy.generateSecret({ name: `Cloudron ${settings.adminFqdn()} (${result.username})` });
|
||||
|
||||
Reference in New Issue
Block a user