From 8c497efb46d2193674fee2e0c9da8053c533e79e Mon Sep 17 00:00:00 2001 From: guillaume Date: Tue, 6 Nov 2018 11:28:35 +0100 Subject: patch authentication --- models/users.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'models') diff --git a/models/users.js b/models/users.js index 630f4703..2e879d94 100644 --- a/models/users.js +++ b/models/users.js @@ -520,10 +520,10 @@ if (Meteor.isServer) { } const disableRegistration = Settings.findOne().disableRegistration; - // 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'; + if (!disableRegistration) { + if (options.ldap) { + user.authenticationMethod = 'ldap'; + } return user; } -- cgit v1.2.3-1-g7c22 From 3646a9c259634bbed03b71ead53338c3f290cf0b Mon Sep 17 00:00:00 2001 From: guillaume Date: Tue, 6 Nov 2018 17:48:12 +0100 Subject: Logout with timer --- models/settings.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'models') diff --git a/models/settings.js b/models/settings.js index c2a9bf01..35d71533 100644 --- a/models/settings.js +++ b/models/settings.js @@ -235,5 +235,28 @@ if (Meteor.isServer) { cas: isCasEnabled(), }; }, + 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': []}} + ); + }, }); } -- cgit v1.2.3-1-g7c22 From 893329d9c6d33aa5572e268e8f951400a2446303 Mon Sep 17 00:00:00 2001 From: guillaume Date: Fri, 9 Nov 2018 17:46:02 +0100 Subject: patch authentication --- models/settings.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'models') diff --git a/models/settings.js b/models/settings.js index 35d71533..6c9f5a53 100644 --- a/models/settings.js +++ b/models/settings.js @@ -76,6 +76,7 @@ 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(); @@ -235,6 +236,12 @@ 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, { @@ -257,6 +264,7 @@ if (Meteor.isServer) { {_id: userId}, {$set: {'services.resume.loginTokens': []}} ); + this.success(); }, }); } -- cgit v1.2.3-1-g7c22