mirror of
https://github.com/documenso/documenso.git
synced 2026-07-25 01:15:49 +10:00
fix: replace z.string().email() with RFC 5322 compliant ZEmail/zEmail (#2655)
This commit is contained in:
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user