mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 07:16:34 +00:00
feat(auth): add validation schema using Zod
This commit is contained in:
parent
3cff6624c8
commit
e6e5ea98ea
13
src/lib/zod.ts
Normal file
13
src/lib/zod.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { z } from "zod";
|
||||||
|
|
||||||
|
export const authSchema = z.object({
|
||||||
|
email: z
|
||||||
|
.string()
|
||||||
|
.nonempty("Email is required")
|
||||||
|
.email("Invalid email"),
|
||||||
|
password: z
|
||||||
|
.string()
|
||||||
|
.nonempty("Password is required")
|
||||||
|
.min(8, "Password must be at least 8 characters")
|
||||||
|
.max(32, "Password must be less than 32 characters"),
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user