fix:login error messages
This commit is contained in:
commit
27fc4e63db
|
|
@ -71,13 +71,22 @@ export default function Login() {
|
|||
} else {
|
||||
// login dengan otp
|
||||
loading();
|
||||
const response = await emailValidation(data);
|
||||
const response: any = await emailValidation(data);
|
||||
if (response?.error) {
|
||||
error("Username / Password Tidak Sesuai");
|
||||
console.log("error", response);
|
||||
if (response?.message?.messages[0]?.includes("failed to send mail")) {
|
||||
error("Gagal Mengirim OTP");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (response?.message?.messages[0]?.includes("username")) {
|
||||
error("Username / Password Tidak Sesuai");
|
||||
return false;
|
||||
}
|
||||
error("Unknown Error");
|
||||
return false;
|
||||
}
|
||||
close();
|
||||
|
||||
if (response?.data?.messages[0] === "Continue to setup email") {
|
||||
setFirstLogin(true);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue