fix: replace z.string().email() with RFC 5322 compliant zEmail() (#2656)

This commit is contained in:
Lucas Smith
2026-03-26 16:31:21 +11:00
committed by GitHub
parent 814f6e62de
commit 2346de83a6
36 changed files with 90 additions and 97 deletions
+5 -5
View File
@@ -1,6 +1,6 @@
import { z } from 'zod';
import { ZEmail } from '@documenso/lib/utils/zod';
import { zEmail } from '@documenso/lib/utils/zod';
export const ZCurrentPasswordSchema = z
.string()
@@ -8,7 +8,7 @@ export const ZCurrentPasswordSchema = z
.max(72);
export const ZSignInSchema = z.object({
email: ZEmail.min(1),
email: zEmail().min(1),
password: ZCurrentPasswordSchema,
totpCode: z.string().trim().optional(),
backupCode: z.string().trim().optional(),
@@ -36,7 +36,7 @@ export const ZPasswordSchema = z
export const ZSignUpSchema = z.object({
name: z.string().min(1),
email: ZEmail,
email: zEmail(),
password: ZPasswordSchema,
signature: z.string().nullish(),
});
@@ -44,7 +44,7 @@ export const ZSignUpSchema = z.object({
export type TSignUpSchema = z.infer<typeof ZSignUpSchema>;
export const ZForgotPasswordSchema = z.object({
email: ZEmail.min(1),
email: zEmail().min(1),
});
export type TForgotPasswordSchema = z.infer<typeof ZForgotPasswordSchema>;
@@ -63,7 +63,7 @@ export const ZVerifyEmailSchema = z.object({
export type TVerifyEmailSchema = z.infer<typeof ZVerifyEmailSchema>;
export const ZResendVerifyEmailSchema = z.object({
email: ZEmail.min(1),
email: zEmail().min(1),
});
export type TResendVerifyEmailSchema = z.infer<typeof ZResendVerifyEmailSchema>;