diff --git a/models/users.js b/models/users.js index 2e879d942..90ae8bf64 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; }