Skip to content

Commit d156a44

Browse files
WebUI: Fix reloading page after login
Manual backport of PR #21832 Original author: Evgenii Ryshkov See commit: 1e851b3
1 parent c3c7f28 commit d156a44

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/webui/www/public/scripts/login.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,13 @@ function submitLoginForm(event) {
3737
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
3838
xhr.addEventListener("readystatechange", () => {
3939
if (xhr.readyState === 4) { // DONE state
40-
if ((xhr.status === 200) && (xhr.responseText === "Ok."))
40+
if ((xhr.status === 200) && (xhr.responseText === "Ok.")) {
4141
location.replace(location);
42-
else
42+
location.reload(true);
43+
}
44+
else {
4345
errorMsgElement.textContent = "QBT_TR(Invalid Username or Password.)QBT_TR[CONTEXT=HttpServer]";
46+
}
4447
}
4548
});
4649
xhr.addEventListener("error", () => {

0 commit comments

Comments
 (0)