import { z } from "zod"; export const loginSchema = z.object({ email: z.string().email("Invalid email address"), password: z.string().min(8, "Password must be at least 8 characters"), }); export const registerSchema = z.object({ name: z.string().min(2, "Name must be at least 2 characters").max(100), email: z.string().email("Invalid email address"), password: z .string() .min(8, "Password must be at least 8 characters") .max(128) .regex(/[A-Z]/, "Password must contain at least one uppercase letter") .regex(/[a-z]/, "Password must contain at least one lowercase letter") .regex(/[0-9]/, "Password must contain at least one number"), }); export const forgotPasswordSchema = z.object({ email: z.string().email("Invalid email address"), }); export const resetPasswordSchema = z.object({ token: z.string().min(1), password: z .string() .min(8, "Password must be at least 8 characters") .max(128) .regex(/[A-Z]/, "Password must contain at least one uppercase letter") .regex(/[a-z]/, "Password must contain at least one lowercase letter") .regex(/[0-9]/, "Password must contain at least one number"), }); export type LoginInput = z.infer; export type RegisterInput = z.infer; export type ForgotPasswordInput = z.infer; export type ResetPasswordInput = z.infer;