From 51baba1f2a962e6f34fada996206ae8c0dbe3017 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sun, 21 Aug 2016 19:59:21 -0600 Subject: [PATCH] Add preAuthIdleLogoutSeconds --- core/client.js | 8 ++++++-- core/config.js | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/core/client.js b/core/client.js index d31e8d9f..bc766a9f 100644 --- a/core/client.js +++ b/core/client.js @@ -402,9 +402,13 @@ Client.prototype.startIdleMonitor = function() { // Every 1m, check for idle. // self.idleCheck = setInterval(function checkForIdle() { - var nowMs = Date.now(); + const nowMs = Date.now(); - if(nowMs - self.lastKeyPressMs >= (Config.misc.idleLogoutSeconds * 1000)) { + const idleLogoutSeconds = self.user.isAuthenticated() ? + Config.misc.idleLogoutSeconds : + Config.misc.preAuthIdleLogoutSeconds; + + if(nowMs - self.lastKeyPressMs >= (idleLogoutSeconds * 1000)) { self.emit('idle timeout'); } }, 1000 * 60); diff --git a/core/config.js b/core/config.js index 49208d01..d060f508 100644 --- a/core/config.js +++ b/core/config.js @@ -287,11 +287,16 @@ function getDefaultConfig() { }, misc : { - idleLogoutSeconds : 60 * 6, // 6m + preAuthIdleLogoutSeconds : 60 * 3, // 2m + idleLogoutSeconds : 60 * 6, // 6m }, logging : { level : 'debug' + }, + + debug : { + assertsEnabled : false, } }; }