APmanageur Wi-Fi V1.0

This commit is contained in:
yoannmultigaming committed 2026-11-18 15:53:34 +01:00
1 parent e54d1b2a7b
commit 77fd75e09b
3 files changed
+36 -24

No files matched your search

+15 -21
View File
@@ -54,25 +54,8 @@
fetch('/api/auth/status', { cache: 'no-store' })
.then(function (r) { return r.json(); })
.then(function (d) {
if (d) {
var isDone = !!(d.setup_completed !== undefined ? d.setup_completed : (d.configured && d.wifi_configured));
if (!isDone && !d.configured && !d.wifi_configured) {
window.location.replace('/setup');
}
}
})
.catch(function () {});
} catch (_) {}
try {
fetch('/api/auth/status', { cache: 'no-store' })
.then(function (r) { return r.json(); })
.then(function (d) {
if (d) {
var isDone = !!(d.setup_completed !== undefined ? d.setup_completed : (d.configured && d.wifi_configured));
if (!isDone && !d.configured && !d.wifi_configured) {
window.location.replace('/setup');
}
if (d && !d.configured) {
window.location.replace('/setup');
}
})
.catch(function () {});
@@ -12974,7 +12957,18 @@ ${vpnBadgeTopo}
try {
const response = await apiFetch('/api/data/clear', { method: 'POST' }); const data = await response.json();
if (!response.ok) throw Error(data.error || 'Suppression refusée');
message.textContent = tMsg(data.message); await new Promise(resolve => setTimeout(resolve, 500)); await load();
message.textContent = tMsg(data.message);
authToken = '';
try {
sessionStorage.removeItem('apAuthToken');
localStorage.removeItem('apAuthToken');
sessionStorage.removeItem('apAppStarted');
localStorage.removeItem('apAppStarted');
sessionStorage.removeItem('apVisited');
clearAuthCookie();
} catch (_) {}
await new Promise(resolve => setTimeout(resolve, 600));
window.location.replace('/setup');
} catch (e) { message.textContent = tErr(e.message); }
});
@@ -14523,7 +14517,7 @@ ${vpnBadgeTopo}
}
authConfigured = !!data.configured; authTwoFactor = !!data.two_factor;
const isSetupDone = !!(data.setup_completed !== undefined ? data.setup_completed : (data.configured && data.wifi_configured));
if (!isSetupDone && !data.configured && !data.wifi_configured) {
if (!authConfigured || (!isSetupDone && !data.wifi_configured)) {
hideLoaderScreen();
window.location.replace('/setup');
return;