next-enterprise/zodSchema/login.tsx
2024-04-22 03:45:44 +00:00

21 lines
681 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { z } from "zod"
/**
* Login and Register Form Schemas
* Types of Login and Register Form Schemas
*/
export const loginSchema = z.object({
email: z.string().email({ message: "invalid Email⚠️" }),
password: z.string().min(1, { message: "invalid Password⚠️" }),
})
export type typeLoginSchema = z.infer<typeof loginSchema>
export const registerSchema = z.object({
name: z.string().min(2, { message: "Name of 2 characters is required!" }),
email: z.string().email({ message: "invalid Email⚠️" }),
password: z.string().min(1, { message: "Password of 6 characters is required!" }),
})
export type typeRegisterSchema = z.infer<typeof registerSchema>