From d156a44f8d3289aa5486634230765c8ac3214a61 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Sun, 8 Dec 2024 12:12:44 +0200 Subject: [PATCH] WebUI: Fix reloading page after login Manual backport of PR #21832 Original author: Evgenii Ryshkov See commit: 1e851b363762e6474be3a5b19f0899d572beaa16 --- src/webui/www/public/scripts/login.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/webui/www/public/scripts/login.js b/src/webui/www/public/scripts/login.js index 598e07699..5950aaa3b 100644 --- a/src/webui/www/public/scripts/login.js +++ b/src/webui/www/public/scripts/login.js @@ -37,10 +37,13 @@ function submitLoginForm(event) { xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8"); xhr.addEventListener("readystatechange", () => { if (xhr.readyState === 4) { // DONE state - if ((xhr.status === 200) && (xhr.responseText === "Ok.")) + if ((xhr.status === 200) && (xhr.responseText === "Ok.")) { location.replace(location); - else + location.reload(true); + } + else { errorMsgElement.textContent = "QBT_TR(Invalid Username or Password.)QBT_TR[CONTEXT=HttpServer]"; + } } }); xhr.addEventListener("error", () => {