Skip to content

Commit

Permalink
fix: validation of email (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlc03 authored Sep 5, 2024
1 parent 7d0ac75 commit 4d3c79a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/backend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof SendOtpSchema>;
Expand Down

0 comments on commit 4d3c79a

Please sign in to comment.