Refactor login redirection logic in setup.html

This commit is contained in:
Théophile Diot 2024-01-25 15:47:27 +01:00
parent 12714a7702
commit e6ee3f0a42
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -629,16 +629,18 @@
setTimeout(() => {
window.open(`${api}/login`, "_self");
}, 60000);
setInterval(() => {
fetch(`${api}/check`, {
cache: "no-cache",
})
.then((res) => {
if (res.status === 200) {
window.open(`${api}/login`, "_self");
}
setTimeout(() => {
setInterval(() => {
fetch(`${api}/check`, {
cache: "no-cache",
})
.catch((err) => {});
.then((res) => {
if (res.status === 200) {
window.open(`${api}/login`, "_self");
}
})
.catch((err) => {});
}, 1000);
}, 5000);
}
})