diff options
author | Lauri Ojansivu <x@xet7.org> | 2018-11-17 16:50:42 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2018-11-17 16:50:42 +0200 |
commit | aa691b0af105c8dbc5443b1e0823a701e53c3871 (patch) | |
tree | 7f76c9e79c6da428d85160ea9108d586a0e560f8 /models | |
parent | 7a75d821147c7d9e2ad48b212348c4bf2d4db063 (diff) | |
download | wekan-aa691b0af105c8dbc5443b1e0823a701e53c3871.tar.gz wekan-aa691b0af105c8dbc5443b1e0823a701e53c3871.tar.bz2 wekan-aa691b0af105c8dbc5443b1e0823a701e53c3871.zip |
- Revert Improve authentication to [fix Login failure](https://github.com/wekan/wekan/issues/2004).
Thanks to xet7 !
Closes #2004
Diffstat (limited to 'models')
-rw-r--r-- | models/settings.js | 31 | ||||
-rw-r--r-- | models/users.js | 8 |
2 files changed, 4 insertions, 35 deletions
diff --git a/models/settings.js b/models/settings.js index 6c9f5a53..c2a9bf01 100644 --- a/models/settings.js +++ b/models/settings.js @@ -76,7 +76,6 @@ if (Meteor.isServer) { }, createdAt: now, modifiedAt: now}; Settings.insert(defaultSetting); } - const newSetting = Settings.findOne(); if (!process.env.MAIL_URL && newSetting.mailUrl()) process.env.MAIL_URL = newSetting.mailUrl(); @@ -236,35 +235,5 @@ if (Meteor.isServer) { cas: isCasEnabled(), }; }, - - getDefaultAuthenticationMethod() { - return process.env.DEFAULT_AUTHENTICATION_METHOD; - }, - - // TODO: patch error : did not check all arguments during call - logoutWithTimer(userId) { - if (process.env.LOGOUT_WITH_TIMER) { - Jobs.run('logOut', userId, { - in: { - days: process.env.LOGOUT_IN, - }, - on: { - hour: process.env.LOGOUT_ON_HOURS, - minute: process.env.LOGOUT_ON_MINUTES, - }, - priority: 1, - }); - } - }, - }); - - Jobs.register({ - logOut(userId) { - Meteor.users.update( - {_id: userId}, - {$set: {'services.resume.loginTokens': []}} - ); - this.success(); - }, }); } diff --git a/models/users.js b/models/users.js index 2e879d94..630f4703 100644 --- a/models/users.js +++ b/models/users.js @@ -520,10 +520,10 @@ if (Meteor.isServer) { } const disableRegistration = Settings.findOne().disableRegistration; - if (!disableRegistration) { - if (options.ldap) { - user.authenticationMethod = 'ldap'; - } + // If ldap, bypass the inviation code if the self registration isn't allowed. + // TODO : pay attention if ldap field in the user model change to another content ex : ldap field to connection_type + if (options.ldap || !disableRegistration) { + user.authenticationMethod = 'ldap'; return user; } |