diff options
author | Lauri Ojansivu <x@xet7.org> | 2018-12-13 14:27:34 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2018-12-13 14:27:34 +0200 |
commit | f8ef8507b5620cee6df73d1cd38df72d18db48e6 (patch) | |
tree | 38ce4106937f0703d1f51b0f71b308537bc3750b /models/users.js | |
parent | 2ae143e6dafd9bbaf212d8a0c1149732980b92a2 (diff) | |
download | wekan-f8ef8507b5620cee6df73d1cd38df72d18db48e6.tar.gz wekan-f8ef8507b5620cee6df73d1cd38df72d18db48e6.tar.bz2 wekan-f8ef8507b5620cee6df73d1cd38df72d18db48e6.zip |
- Fix [Cannot login with new LDAP account when auto-registration disabled (request invitation code)](https://github.com/wekan/wekan-ldap/issues/29);
- Fix [Unable to create new account from LDAP](https://github.com/wekan/wekan-ldap/issues/32).
Thanks to Akuket !
Closes wekan/wekan-ldap#29,
closes wekan/wekan-ldap#32
Diffstat (limited to 'models/users.js')
-rw-r--r-- | models/users.js | 10 |
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; } |