init
This commit is contained in:
28
frontend/lib/definitions.ts
Normal file
28
frontend/lib/definitions.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user