fix: replace z.string().email() with RFC 5322 compliant ZEmail/zEmail (#2655)

This commit is contained in:
Lucas Smith
2026-03-26 13:31:26 +11:00
committed by GitHub
parent 0434bdfacf
commit 814f6e62de
49 changed files with 172 additions and 95 deletions
+6 -4
View File
@@ -1,12 +1,14 @@
import { z } from 'zod';
import { ZEmail } from '@documenso/lib/utils/zod';
export const ZCurrentPasswordSchema = z
.string()
.min(6, { message: 'Must be at least 6 characters in length' })
.max(72);
export const ZSignInSchema = z.object({
email: z.string().email().min(1),
email: ZEmail.min(1),
password: ZCurrentPasswordSchema,
totpCode: z.string().trim().optional(),
backupCode: z.string().trim().optional(),
@@ -34,7 +36,7 @@ export const ZPasswordSchema = z
export const ZSignUpSchema = z.object({
name: z.string().min(1),
email: z.string().email(),
email: ZEmail,
password: ZPasswordSchema,
signature: z.string().nullish(),
});
@@ -42,7 +44,7 @@ export const ZSignUpSchema = z.object({
export type TSignUpSchema = z.infer<typeof ZSignUpSchema>;
export const ZForgotPasswordSchema = z.object({
email: z.string().email().min(1),
email: ZEmail.min(1),
});
export type TForgotPasswordSchema = z.infer<typeof ZForgotPasswordSchema>;
@@ -61,7 +63,7 @@ export const ZVerifyEmailSchema = z.object({
export type TVerifyEmailSchema = z.infer<typeof ZVerifyEmailSchema>;
export const ZResendVerifyEmailSchema = z.object({
email: z.string().email().min(1),
email: ZEmail.min(1),
});
export type TResendVerifyEmailSchema = z.infer<typeof ZResendVerifyEmailSchema>;