WebAPI: Respond with more detailed info

* WebAPI: return error message when endpoint not found
* WebAPI: send appropriate status code when logging in
* WebAPI: return more info when adding torrents

PR #23202.
Closes #375.
Closes #10688.
Closes #10747.
Closes #11464.
This commit is contained in:
Thomas (Tom) Piccirello
2025-09-12 07:53:48 -07:00
committed by GitHub
parent 69b2d7a53e
commit 7ddbf58a3b
8 changed files with 76 additions and 17 deletions

View File

@@ -45,12 +45,12 @@ const submitLoginForm = (event) => {
})
})
.then(async (response) => {
const responseText = await response.text();
if (response.ok && (responseText === "Ok.")) {
if (response.ok) {
location.replace(location); // redirect
location.reload(true);
}
else {
const responseText = await response.text();
errorMsgElement.textContent = `QBT_TR(Invalid Username or Password.)QBT_TR[CONTEXT=Login]\nQBT_TR(Server response:)QBT_TR[CONTEXT=Login] ${responseText}`;
}
},