login authentication changes

This commit is contained in:
2022-11-30 10:09:01 +05:30
bovenliggende f05319114b
commit bdc98e7107
+10 -4
Bestand weergeven
@@ -75,11 +75,17 @@ function loginUser(email, password) {
fetch(serverUrl + 'account/login', requestOptions)
.then((response) => response.text())
.then((result) => {
const user = JSON.parse(result);
setCookie('authentication', user.result.sessionId, 1);
window.location = '../authentication';
const data = JSON.parse(result);
if (data.status === 0) {
setCookie('authentication', data.result.sessionId, 1);
window.location = '../authentication';
} else {
passwordErrEl.innerText = data.message;
}
})
.catch((error) => console.log('error', error));
.catch((error) => {
passwordErrEl.innerText = error;
});
}
function validateLogin() {