From 4e91cb48d38c4f060bafd3854e6fb413277acaaf Mon Sep 17 00:00:00 2001 From: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> Date: Thu, 5 Sep 2024 12:54:52 +0100 Subject: [PATCH] fix: validation of email --- packages/backend/src/types.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/types.ts b/packages/backend/src/types.ts index c05be73..ce587bf 100644 --- a/packages/backend/src/types.ts +++ b/packages/backend/src/types.ts @@ -2,7 +2,9 @@ import { isAddress } from "viem"; import z from "zod"; export const SendOtpSchema = z.object({ - email: z.string().email().endsWith("@pse.dev"), + email: z.string().email().endsWith("@pse.dev").refine(email => !email.includes('+'), { + message: "Email must not contain '+'" + }), }); export type SendOtp = z.infer;