🔒 Registration form hardening (#1160)

This commit is contained in:
Luke Vella 2024-06-19 09:16:33 +01:00 committed by GitHub
parent db8655aab9
commit c307963a0e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 154 additions and 99 deletions

View file

@ -12,8 +12,8 @@ export const auth = router({
requestRegistration: publicProcedure
.input(
z.object({
name: z.string(),
email: z.string(),
name: z.string().nonempty().max(100),
email: z.string().email(),
}),
)
.mutation(

View file

@ -53,7 +53,7 @@ export const participants = router({
.input(
z.object({
pollId: z.string(),
name: z.string().min(1, "Participant name is required"),
name: z.string().min(1, "Participant name is required").max(100),
email: z.string().optional(),
votes: z
.object({

View file

@ -29,7 +29,7 @@ const buttonVariants = cva(
size: {
default: "h-9 px-2.5 gap-x-2.5 text-sm",
sm: "h-7 text-sm px-1.5 gap-x-1.5 rounded-md",
lg: "h-11 text-sm gap-x-3 px-4 rounded-md",
lg: "h-11 text-base gap-x-3 px-4 rounded-md",
},
},
defaultVariants: {