29 lines
534 B
TypeScript
29 lines
534 B
TypeScript
import { z } from "zod";
|
|
|
|
export const SignupFormSchema = z.object({
|
|
name: z
|
|
.string()
|
|
.min(2, { message: "Name must be at least 2 characters long." })
|
|
.trim(),
|
|
password: z
|
|
.string()
|
|
.min(4, { message: "Be at least 8 characters long" })
|
|
.trim(),
|
|
});
|
|
|
|
export type FormState =
|
|
| {
|
|
errors?: {
|
|
name?: string[];
|
|
email?: string[];
|
|
password?: string[];
|
|
};
|
|
message?: string;
|
|
}
|
|
| undefined;
|
|
|
|
export interface SessionPayload {
|
|
userId: string;
|
|
expiresAt: Date;
|
|
}
|