Skip to content
Snippets Groups Projects
Commit c8d3fda1 authored by Marcelo Schmidt's avatar Marcelo Schmidt
Browse files

Fix registration when allow registration from services is disabled

parent 8dd046b5
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@ RocketChat.settings.add = (_id, value, options = {}) ->
options.packageValue = value
options.valueSource = 'packageValue'
options.ts = new Date
options.hidden = false
if process?.env?[_id]?
value = process.env[_id]
......@@ -55,6 +56,7 @@ RocketChat.settings.addGroup = (_id, options = {}) ->
options.i18nDescription = "#{_id}_Description"
options.ts = new Date
options.hidden = false
return RocketChat.models.Settings.upsert { _id: _id },
$set: options
......
......@@ -108,6 +108,6 @@ Accounts.validateLoginAttempt (login) ->
return true
Accounts.validateNewUser (user) ->
if RocketChat.settings.get('Accounts_Registration_AuthenticationServices_Enabled') is false and user.services?
if RocketChat.settings.get('Accounts_Registration_AuthenticationServices_Enabled') is false and RocketChat.settings.get('LDAP_Enable') is false and not user.services?.password?
throw new Meteor.Error 'registration-disabled-authentication-services', 'User registration is disabled for authentication services'
return true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment