2021-07-31 15:57:43 +00:00
|
|
|
import { z } from "zod";
|
2021-07-31 14:33:18 +00:00
|
|
|
|
2021-09-24 23:09:20 +00:00
|
|
|
export const password = z.string().min(10).max(100);
|
2021-07-31 14:33:18 +00:00
|
|
|
|
|
|
|
export const Signup = z.object({
|
2021-09-25 14:16:31 +00:00
|
|
|
fullName: z.string(),
|
2021-07-31 14:33:18 +00:00
|
|
|
email: z.string().email(),
|
|
|
|
password,
|
2021-07-31 15:57:43 +00:00
|
|
|
});
|
2021-07-31 14:33:18 +00:00
|
|
|
|
|
|
|
export const Login = z.object({
|
|
|
|
email: z.string().email(),
|
|
|
|
password: z.string(),
|
2021-07-31 15:57:43 +00:00
|
|
|
});
|
2021-07-31 14:33:18 +00:00
|
|
|
|
|
|
|
export const ForgotPassword = z.object({
|
|
|
|
email: z.string().email(),
|
2021-07-31 15:57:43 +00:00
|
|
|
});
|
2021-07-31 14:33:18 +00:00
|
|
|
|
|
|
|
export const ResetPassword = z
|
|
|
|
.object({
|
|
|
|
password: password,
|
|
|
|
passwordConfirmation: password,
|
|
|
|
token: z.string(),
|
|
|
|
})
|
|
|
|
.refine((data) => data.password === data.passwordConfirmation, {
|
|
|
|
message: "Passwords don't match",
|
|
|
|
path: ["passwordConfirmation"], // set the path of the error
|
2021-07-31 15:57:43 +00:00
|
|
|
});
|