mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-21 10:15:55 +02:00
Add preAuthIdleLogoutSeconds
This commit is contained in:
parent
d50e505bd7
commit
51baba1f2a
2 changed files with 12 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue