https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36586 --- Comment #57 from Michael Grgurev <mike.grgurev@mainlib.org> --- /* Interim fix for use in SCOUserJS */ /* ---- Self checkout page reload on idle to avoid CSRF errors ---- */ /* IF STATEMENT: Limit to cardnumber entry screen, though not strictly necessary */ if(document.body.id == "sco_main" && !$('body').hasClass('CheckingOut')) { let timeoutMinutes = 5; /* Time, in minutes, to refresh when no user input. */ let idleTimer = 0; const idleInterval = setInterval(idleUpdate, 1000); const idleThreshold = timeoutMinutes * 60; function resetTimer() { idleTimer = 0; } function idleUpdate() { idleTimer++; if (idleTimer >= idleThreshold) { location.reload(true); /* Reload page to refresh CSRF token */ clearInterval(idleInterval); } } /* Check for standard user input events (no reload when interaction is occuring) */ for (var e of ["mousemove","keypress","mousedown","touchstart","scroll"]) { document.addEventListener(e, resetTimer); } resetTimer(); } -- You are receiving this mail because: You are watching all bug changes.