fix:error message login
This commit is contained in:
parent
2112cfabd9
commit
ca0b40663a
|
|
@ -69,12 +69,23 @@ export default function Login() {
|
||||||
error("Username & Password Wajib Diisi !");
|
error("Username & Password Wajib Diisi !");
|
||||||
} else {
|
} else {
|
||||||
// login dengan otp
|
// login dengan otp
|
||||||
const response = await emailValidation(data);
|
loading();
|
||||||
|
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();
|
||||||
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