UNPKG

starkon

Version:

Complete Next.js boilerplate with authentication, i18n & CLI - Create production-ready apps instantly

22 lines (19 loc) 702 B
import { z } from 'zod' /** * Reset password form validation schema */ export const resetPasswordSchema = z .object({ newPassword: z .string() .min(8, 'Password must be at least 8 characters') .regex(/(?=.*[a-z])/, 'Password must contain at least one lowercase letter') .regex(/(?=.*[A-Z])/, 'Password must contain at least one uppercase letter') .regex(/(?=.*\d)/, 'Password must contain at least one number'), confirmPassword: z.string(), }) .refine((data) => data.newPassword === data.confirmPassword, { message: 'Passwords do not match', path: ['confirmPassword'], }) export type ResetPasswordFormData = z.infer<typeof resetPasswordSchema>