Register and OTP (#31)

* feat: responsive

* fix: success register

* feat: auth login responsive && auth login implementation

* fix: login page button disabled & register page

* fix: conflict

* fix: button disabled when loading

* feat: register and otp integration

* Update middleware.ts
This commit is contained in:
Naufal Azmi
2025-05-26 20:49:57 +07:00
committed by GitHub
parent 0f46244d2b
commit aaf5b4262d
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;
};