diff --git a/js/controller.js b/js/controller.js index ef47952..c8eec1d 100644 --- a/js/controller.js +++ b/js/controller.js @@ -30,7 +30,11 @@ function logIn() { .catch(error => { console.error(error); buttonEnable(byId("login_button")); - byId("login_message").innerText = `${error}`; + 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}`; + } }); }