From 18842fdd35d387fef89b8b73f40c9db334f54121 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Sun, 16 Dec 2018 22:25:48 +0300 Subject: process 401 and 403 --- web/share/js/index/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'web/share/js/index/main.js') diff --git a/web/share/js/index/main.js b/web/share/js/index/main.js index f42b9af6..369706ac 100644 --- a/web/share/js/index/main.js +++ b/web/share/js/index/main.js @@ -53,6 +53,8 @@ function __loadKvmdInfo() { $("kvmd-meta-server-host").innerHTML = ""; document.title = "Pi-KVM Index"; } + } else if (http.status === 401 || http.status === 403) { + document.location.href = "/login"; } else { setTimeout(__loadKvmdInfo, 1000); } @@ -76,7 +78,7 @@ function __makeApp(id, path, icon, name) { function __logout() { var http = tools.makeRequest("POST", "/kvmd/auth/logout", function() { if (http.readyState === 4) { - if (http.status === 200) { + if (http.status === 200 || http.status === 401 || http.status === 403) { document.location.href = "/login"; } else { wm.error("Logout error:
", http.responseText); -- cgit v1.2.3