refactor: remove console log and enhance error handling in signin and resend OTP actions

This commit is contained in:
arraysid
2025-05-29 18:15:15 +07:00
parent d96df63660
commit 031256ec4e
5 changed files with 24 additions and 11 deletions
@@ -19,13 +19,13 @@ export async function resendOTPAction(request: ResendOTPValidationType) {
if (!isCapchaValid) throw new Error('Failed to verify captcha');
const { data } = await fetcher.POST('/v1/auth/send-otp', {
const { data, error } = await fetcher.POST('/v1/auth/send-otp', {
body: {
email: validRequest.email,
},
});
console.log(data);
if (error) throw new Error(error.message);
return data?.message;
return data;
}