summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/users.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/models/users.js b/models/users.js
index 2e879d94..90ae8bf6 100644
--- a/models/users.js
+++ b/models/users.js
@@ -520,10 +520,14 @@ if (Meteor.isServer) {
}
const disableRegistration = Settings.findOne().disableRegistration;
+ // If this is the first Authentication by the ldap and self registration disabled
+ if (disableRegistration && options.ldap) {
+ user.authenticationMethod = 'ldap';
+ return user;
+ }
+
+ // If self registration enabled
if (!disableRegistration) {
- if (options.ldap) {
- user.authenticationMethod = 'ldap';
- }
return user;
}