Add preAuthIdleLogoutSeconds

This commit is contained in:
Bryan Ashby 2016-08-21 19:59:21 -06:00
parent d50e505bd7
commit 51baba1f2a
2 changed files with 12 additions and 3 deletions

View File

@ -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);

View File

@ -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,
}
};
}