Improve error when login fails
This commit is contained in:
parent
bfe52fbbca
commit
38a3bec0a4
1 changed files with 5 additions and 1 deletions
|
@ -30,7 +30,11 @@ function logIn() {
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
buttonEnable(byId("login_button"));
|
buttonEnable(byId("login_button"));
|
||||||
|
if (error.xhr && error.xhr.responseJson && error.xhr.responseJson.message) {
|
||||||
|
byId("login_message").innerText = `Error: ${error.xhr.responseJson.message}`;
|
||||||
|
} else {
|
||||||
byId("login_message").innerText = `${error}`;
|
byId("login_message").innerText = `${error}`;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue