Files
Homarr/packages/validation/src/user.ts
Meier Lukas a082f70470 feat: add next-international translations (#2)
* feat: add next-international translations
* chore: fix formatting
* chore: address pull request feedback
2023-12-19 23:09:41 +01:00

21 lines
497 B
TypeScript

import { z } from "zod";
const usernameSchema = z.string().min(3).max(255);
const passwordSchema = z.string().min(8).max(255);
export const initUserSchema = z
.object({
username: usernameSchema,
password: passwordSchema,
confirmPassword: z.string(),
})
.refine((data) => data.password === data.confirmPassword, {
path: ["confirmPassword"],
message: "Passwords do not match",
});
export const signInSchema = z.object({
name: z.string(),
password: z.string(),
});