From c3ae5c1cfb2c4957bf8754a75f6979afc3940c5c Mon Sep 17 00:00:00 2001 From: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> Date: Fri, 30 Aug 2024 10:46:16 +0100 Subject: [PATCH] fix: prevent email reuse --- packages/backend/src/types.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/types.ts b/packages/backend/src/types.ts index 8ab2247..c05be73 100644 --- a/packages/backend/src/types.ts +++ b/packages/backend/src/types.ts @@ -8,7 +8,12 @@ export const SendOtpSchema = z.object({ export type SendOtp = z.infer; export const VerifyOtpSchema = 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 '+'" + }), otp: z.number().int().gte(100000).lte(999999), address: z.string().refine(isAddress, { message: "Invalid address",