Fixed reloading page after login

This commit is contained in:
Evgenii Ryshkov 2024-11-14 18:38:14 +03:00 committed by GitHub
commit 95b703244e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -51,8 +51,10 @@ const submitLoginForm = (event) => {
})
.then(async (response) => {
const responseText = await response.text();
if (response.ok && (responseText === "Ok."))
location.reload(); // reload after login
if (response.ok && (responseText === "Ok.")) {
location.replace(location); // redirect
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}`;
},