mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 06:01:33 -06:00
WebUI: Fix reloading page after login
Manual backport of PR #21832
Original author: Evgenii Ryshkov
See commit: 1e851b3637
This commit is contained in:
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user