mirror of
https://github.com/nextcloud/server.git
synced 2026-05-19 08:25:56 -04:00
stop the auto-logout loop after redirecting to the logout
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
This commit is contained in:
parent
98845b4fbd
commit
7f30fbf1db
1 changed files with 5 additions and 2 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue