login authentication changes
This commit is contained in:
+10
-4
@@ -75,11 +75,17 @@ function loginUser(email, password) {
|
|||||||
fetch(serverUrl + 'account/login', requestOptions)
|
fetch(serverUrl + 'account/login', requestOptions)
|
||||||
.then((response) => response.text())
|
.then((response) => response.text())
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
const user = JSON.parse(result);
|
const data = JSON.parse(result);
|
||||||
setCookie('authentication', user.result.sessionId, 1);
|
if (data.status === 0) {
|
||||||
window.location = '../authentication';
|
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() {
|
function validateLogin() {
|
||||||
|
|||||||
Reference in New Issue
Block a user