feat: register and otp integration

This commit is contained in:
boboiazumi
2025-05-26 20:14:26 +07:00
parent 363f1582c9
commit 935d23887c
14 changed files with 273 additions and 90 deletions
+2 -2
View File
@@ -34,8 +34,8 @@ export const postVerifyEmail = async (
): Promise<TResponseMessage> => {
const { data } = await api({
method: 'POST',
url: '/auth/verify',
data: payload,
url: '/auth/verify-email',
data: {otp: parseInt(payload.otp), email: payload.email},
});
return data;
};
+9
View File
@@ -57,3 +57,12 @@ export const authRegisterSchema = z
message: 'Password dan Konfirmasi Password harus sama',
path: ['confirm_password'],
});
export const verifyEmailSchema = z
.object({
otp: z
.string({
required_error: 'OTP tidak boleh kosong',
})
.min(6, 'Masukkan kode 6 digit yang dikirimkan ke email')
})
+2 -2
View File
@@ -20,10 +20,10 @@ export type TRegisterRequest = z.infer<typeof authRegisterSchema>;
export type TRegisterResponse = TResponseDetail<TResponseMessage>;
export type TVerifyOtpRequest = {
otp: number;
otp: string;
};
export type TVerifyEmailRequest = {
email: string;
otp: number;
otp: string;
};