fix: enforce email length validation in reset password form

- Added a maximum length constraint of 255 characters for the email input field.
- Updated validation schema to include a message for exceeding the maximum length.
This commit is contained in:
Mauricio Siu
2026-04-28 18:08:37 -06:00
parent fb6b06f064
commit ed006dc5f9
+4 -1
View File
@@ -30,6 +30,9 @@ const loginSchema = z.object({
.min(1, { .min(1, {
message: "Email is required", message: "Email is required",
}) })
.max(255, {
message: "Email must be at most 255 characters",
})
.email({ .email({
message: "Email must be a valid email", message: "Email must be a valid email",
}), }),
@@ -118,7 +121,7 @@ export default function Home() {
<FormItem> <FormItem>
<FormLabel>Email</FormLabel> <FormLabel>Email</FormLabel>
<FormControl> <FormControl>
<Input placeholder="Email" {...field} /> <Input placeholder="Email" maxLength={255} {...field} />
</FormControl> </FormControl>
<FormMessage /> <FormMessage />
</FormItem> </FormItem>