From 4e4e6a55baf4e732e2367d818e288e713090ddff Mon Sep 17 00:00:00 2001 From: logicog Date: Wed, 26 Nov 2025 21:20:46 +0100 Subject: [PATCH] Redirect to login page when status request not authorized --- html/main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/html/main.js b/html/main.js index 27a8587..eac133e 100644 --- a/html/main.js +++ b/html/main.js @@ -10,6 +10,8 @@ var numPorts = 0; function update() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { + if (this.readyState == 4 && this.status == 401) + document.location = "/login.html" if (this.readyState == 4 && this.status == 200) { const s = JSON.parse(xhttp.responseText); if (!numPorts) {