mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-22 01:06:03 +03:00
WebUI: Fix reloading page after login
PR #21832. --------- Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
This commit is contained in:
parent
c9c85eeb95
commit
1e851b3637
1 changed files with 5 additions and 2 deletions
|
@ -51,10 +51,13 @@ const submitLoginForm = (event) => {
|
||||||
})
|
})
|
||||||
.then(async (response) => {
|
.then(async (response) => {
|
||||||
const responseText = await response.text();
|
const responseText = await response.text();
|
||||||
if (response.ok && (responseText === "Ok."))
|
if (response.ok && (responseText === "Ok.")) {
|
||||||
location.replace(location); // redirect
|
location.replace(location); // redirect
|
||||||
else
|
location.reload(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
errorMsgElement.textContent = `QBT_TR(Invalid Username or Password.)QBT_TR[CONTEXT=Login]\nQBT_TR(Server response:)QBT_TR[CONTEXT=Login] ${responseText}`;
|
errorMsgElement.textContent = `QBT_TR(Invalid Username or Password.)QBT_TR[CONTEXT=Login]\nQBT_TR(Server response:)QBT_TR[CONTEXT=Login] ${responseText}`;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
errorMsgElement.textContent = `QBT_TR(Unable to log in, server is probably unreachable.)QBT_TR[CONTEXT=Login]\n${error}`;
|
errorMsgElement.textContent = `QBT_TR(Unable to log in, server is probably unreachable.)QBT_TR[CONTEXT=Login]\n${error}`;
|
||||||
|
|
Loading…
Reference in a new issue