mirror of
https://github.com/xCyanGrizzly/DragonsStash.git
synced 2026-05-11 06:11:15 +00:00
Some checks failed
continuous-integration/drone/push Build is failing
- Add InviteCode model with code, maxUses, expiry, usage tracking - Registration now requires a valid invite code - New users get USER role instead of ADMIN - Admin-only /invites page to create, manage, and share invite codes - Invite links auto-fill code via ?code= URL param - Drone pipeline now builds app, worker, and bot images separately - Add NEXT_PUBLIC_APP_URL build arg to fix URL redirects
23 lines
772 B
TypeScript
23 lines
772 B
TypeScript
import { z } from "zod/v4";
|
|
|
|
export const loginSchema = z.object({
|
|
email: z.email("Invalid email address"),
|
|
password: z.string().min(6, "Password must be at least 6 characters"),
|
|
});
|
|
|
|
export const registerSchema = z
|
|
.object({
|
|
name: z.string().min(2, "Name must be at least 2 characters"),
|
|
email: z.email("Invalid email address"),
|
|
password: z.string().min(6, "Password must be at least 6 characters"),
|
|
confirmPassword: z.string(),
|
|
inviteCode: z.string().min(1, "Invite code is required"),
|
|
})
|
|
.refine((data) => data.password === data.confirmPassword, {
|
|
message: "Passwords do not match",
|
|
path: ["confirmPassword"],
|
|
});
|
|
|
|
export type LoginInput = z.infer<typeof loginSchema>;
|
|
export type RegisterInput = z.infer<typeof registerSchema>;
|