diff options
author | Julien Veyssier <julien-nc@posteo.net> | 2024-02-20 17:51:16 +0100 |
---|---|---|
committer | nextcloud-command <nextcloud-command@users.noreply.github.com> | 2024-02-21 09:35:00 +0000 |
commit | 687e9418d47131c115ee813b321120db4055162f (patch) | |
tree | 5924fbf7d380353ec14d0bbea4dd3a01e52558df | |
parent | dd291e1a167e25f3c94874715f0d5d756da64194 (diff) | |
download | nextcloud-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.js | 7 |
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) } /** |