summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Veyssier <julien-nc@posteo.net>2024-02-20 17:51:16 +0100
committernextcloud-command <nextcloud-command@users.noreply.github.com>2024-02-21 09:35:00 +0000
commit687e9418d47131c115ee813b321120db4055162f (patch)
tree5924fbf7d380353ec14d0bbea4dd3a01e52558df
parentdd291e1a167e25f3c94874715f0d5d756da64194 (diff)
downloadnextcloud-server-687e9418d47131c115ee813b321120db4055162f.tar.gz
nextcloud-server-687e9418d47131c115ee813b321120db4055162f.zip
stop the auto-logout loop after redirecting to the logout
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
-rw-r--r--core/src/session-heartbeat.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/src/session-heartbeat.js b/core/src/session-heartbeat.js
index 153408b767b..83fa4aeaf12 100644
--- a/core/src/session-heartbeat.js
+++ b/core/src/session-heartbeat.js
@@ -128,14 +128,17 @@ const registerAutoLogout = () => {
lastActive = e.newValue
})
- setInterval(function() {
+ let intervalId = 0
+ const logoutCheck = () => {
const timeout = Date.now() - config.session_lifetime * 1000
if (lastActive < timeout) {
+ clearTimeout(intervalId)
console.info('Inactivity timout reached, logging out')
const logoutUrl = generateUrl('/logout') + '?requesttoken=' + encodeURIComponent(getRequestToken())
window.location = logoutUrl
}
- }, 1000)
+ }
+ intervalId = setInterval(logoutCheck, 1000)
}
/**