1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00
This commit is contained in:
Martin Mädler 2025-03-05 11:48:40 +01:00
parent c6da201af8
commit bc8aa9bff7
5 changed files with 18 additions and 6 deletions

View file

@ -601,8 +601,8 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
}
if (typeof domain.userconsentflags == 'number') { serverinfo.consent = domain.userconsentflags; }
if ((typeof domain.usersessionidletimeout == 'number') && (domain.usersessionidletimeout > 0)) {serverinfo.timeout = (domain.usersessionidletimeout * 60 * 1000); }
if (typeof domain.logoutOnIdleSessionTimeout == 'boolean') {
serverinfo.logoutOnIdleSessionTimeout = domain.logoutOnIdleSessionTimeout;
if (typeof domain.logoutonidlesessiontimeout == 'boolean') {
serverinfo.logoutOnIdleSessionTimeout = domain.logoutonidlesessiontimeout;
} else {
// Default
serverinfo.logoutOnIdleSessionTimeout = true;

View file

@ -1524,8 +1524,12 @@
function setSessionActivity() { sessionActivity = Date.now(); }
function checkIdleSessionTimeout() {
var delta = (Date.now() - sessionActivity);
if (delta > serverinfo.timeout && serverinfo.logoutOnIdleSessionTimeout) {
window.location.href = 'logout';
if (delta > serverinfo.timeout) {
if (serverinfo.logoutOnIdleSessionTimeout) {
window.location.href = 'logout';
} else {
setSessionActivity();
}
}
}

View file

@ -2449,6 +2449,8 @@
}
if (serverinfo.logoutOnIdleSessionTimeout) {
window.location.href = 'logout';
} else {
setSessionActivity();
}
} else {
var ds = Math.round((serverinfo.timeout - delta) / 1000);

View file

@ -2899,6 +2899,8 @@
}
if (serverinfo.logoutOnIdleSessionTimeout) {
window.location.href = 'logout';
} else {
setSessionActivity();
}
} else {
var ds = Math.round((serverinfo.timeout - delta) / 1000);

View file

@ -822,8 +822,12 @@
function setSessionActivity() { sessionActivity = Date.now(); }
function checkIdleSessionTimeout() {
var delta = (Date.now() - sessionActivity);
if (delta > serverinfo.timeout && serverinfo.logoutOnIdleSessionTimeout) {
window.location.href = 'logout';
if (delta > serverinfo.timeout) {
if (serverinfo.logoutOnIdleSessionTimeout) {
window.location.href = 'logout';
} else {
setSessionActivity();
}
}
}