mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-02 09:48:22 +00:00
fix: enhance verification feedback in VerifyRegistrationOTP function and update UI messages
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 5m46s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 5m46s
This commit is contained in:
@ -180,27 +180,26 @@ export async function VerifyRegistrationOTP(
|
||||
};
|
||||
}
|
||||
if (userVerified.verified) {
|
||||
const [mobileLoginError, mobileLoginResponse] = await tryCatch(
|
||||
backendMobileLogin({ mobile: mobile as string }),
|
||||
);
|
||||
if (mobileLoginError) {
|
||||
return {
|
||||
message: "Login Failed. Please contact support.",
|
||||
status: "login_error",
|
||||
};
|
||||
}
|
||||
if (mobileLoginResponse) {
|
||||
redirect(`/auth/verify-otp?phone_number=${mobile}`);
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
message: "Your account could not be verified. Please contact support.",
|
||||
status: "verify_error",
|
||||
message:
|
||||
"Your account has been successfully verified! You may login now.",
|
||||
status: "verify_success",
|
||||
};
|
||||
// const [mobileLoginError, mobileLoginResponse] = await tryCatch(
|
||||
// backendMobileLogin({ mobile: mobile as string }),
|
||||
// );
|
||||
// if (mobileLoginError) {
|
||||
// return {
|
||||
// message: "Login Failed. Please contact support.",
|
||||
// status: "login_error",
|
||||
// };
|
||||
// }
|
||||
// if (mobileLoginResponse) {
|
||||
// redirect(`/auth/verify-otp?phone_number=${mobile}`);
|
||||
// }
|
||||
}
|
||||
|
||||
return {
|
||||
message: data.message,
|
||||
status: response.status === 200 ? "success" : "error",
|
||||
message: "Your account could not be verified. Please contact support.",
|
||||
status: "verify_error",
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user