mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 05:43:32 -07:00
WebUI: Fix reloading page after login
Manual backport of PR #21832
Original author: Evgenii Ryshkov
See commit: 1e851b3637
This commit is contained in:
parent
c3c7f28bad
commit
d156a44f8d
1 changed files with 5 additions and 2 deletions
|
@ -37,11 +37,14 @@ function submitLoginForm(event) {
|
||||||
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
|
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
|
||||||
xhr.addEventListener("readystatechange", () => {
|
xhr.addEventListener("readystatechange", () => {
|
||||||
if (xhr.readyState === 4) { // DONE state
|
if (xhr.readyState === 4) { // DONE state
|
||||||
if ((xhr.status === 200) && (xhr.responseText === "Ok."))
|
if ((xhr.status === 200) && (xhr.responseText === "Ok.")) {
|
||||||
location.replace(location);
|
location.replace(location);
|
||||||
else
|
location.reload(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
errorMsgElement.textContent = "QBT_TR(Invalid Username or Password.)QBT_TR[CONTEXT=HttpServer]";
|
errorMsgElement.textContent = "QBT_TR(Invalid Username or Password.)QBT_TR[CONTEXT=HttpServer]";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
xhr.addEventListener("error", () => {
|
xhr.addEventListener("error", () => {
|
||||||
errorMsgElement.textContent = (xhr.responseText !== "")
|
errorMsgElement.textContent = (xhr.responseText !== "")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue