Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | import { z } from 'zod';
import validator from 'validator';
// REQUEST VERIFICATION
export const requestVerificationSchema = z.object({
email: z.string().email(),
});
// CONFIRM VERIFICATION
export const confirmVerificationSchema = z.object({
token: z.string().min(1),
});
// LOGIN
export const loginSchema = z.object({
email: z.string().min(1).email(),
password: z.string().min(1)
});
// REQUEST PASSWORD RESET
export const requestPasswordResetSchema = z.object({
email: z.string().min(1).email(),
});
// CONFIRM PASSWORD RESET
export const confirmPasswordResetSchema = z.object({
token: z.string().min(1),
password: z.string().refine((val) => val && validator.isStrongPassword(val), {
message: 'This value must be min 6 characters long and contain uppercase, lowercase, number, specialchar.',
}),
confirmPassword: z.string(),
}).refine((data) => data.password === data.confirmPassword, {
message: "Passwords don't match",
path: ["confirmPassword"],
}); |