diff --git a/src/pages/Login/index.tsx b/src/pages/Login/index.tsx index 25931ba..be01327 100644 --- a/src/pages/Login/index.tsx +++ b/src/pages/Login/index.tsx @@ -24,10 +24,15 @@ function Login() { e.preventDefault(); try { const res = await loginService({ username: form.username, password: form.password }) - if (res.error) { + if (res.error.response.status == 400) { setErrorMsg(res.error.response.data.errors) return } + + if(res.error) { + alert(res.error.response.data.message) + return + } dispatch(authAdded(res.data)) @@ -91,6 +96,9 @@ function Login() { + {errorMsg.map(x => ( +
{x.msg}
+ ))} Forgout account ?