|
@@ -75,11 +75,17 @@ function loginUser(email, password) {
|
75
|
75
|
fetch(serverUrl + 'account/login', requestOptions)
|
76
|
76
|
.then((response) => response.text())
|
77
|
77
|
.then((result) => {
|
78
|
|
- const user = JSON.parse(result);
|
79
|
|
- setCookie('authentication', user.result.sessionId, 1);
|
80
|
|
- window.location = '../authentication';
|
|
78
|
+ const data = JSON.parse(result);
|
|
79
|
+ if (data.status === 0) {
|
|
80
|
+ setCookie('authentication', data.result.sessionId, 1);
|
|
81
|
+ window.location = '../authentication';
|
|
82
|
+ } else {
|
|
83
|
+ passwordErrEl.innerText = data.message;
|
|
84
|
+ }
|
81
|
85
|
})
|
82
|
|
- .catch((error) => console.log('error', error));
|
|
86
|
+ .catch((error) => {
|
|
87
|
+ passwordErrEl.innerText = error;
|
|
88
|
+ });
|
83
|
89
|
}
|
84
|
90
|
|
85
|
91
|
function validateLogin() {
|