fix:login error messages
This commit is contained in:
commit
27fc4e63db
|
|
@ -71,13 +71,22 @@ export default function Login() {
|
||||||
} else {
|
} else {
|
||||||
// login dengan otp
|
// login dengan otp
|
||||||
loading();
|
loading();
|
||||||
const response = await emailValidation(data);
|
const response: any = await emailValidation(data);
|
||||||
if (response?.error) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
close();
|
close();
|
||||||
|
|
||||||
if (response?.data?.messages[0] === "Continue to setup email") {
|
if (response?.data?.messages[0] === "Continue to setup email") {
|
||||||
setFirstLogin(true);
|
setFirstLogin(true);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue