Skip to content

Commit

Permalink
Merge pull request #323 from AdarshGT33/main
Browse files Browse the repository at this point in the history
updated email validation regex
  • Loading branch information
subhadeeproy3902 authored Jun 18, 2024
2 parents ab0af64 + 61bbb3e commit 7839611
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"remark-parse": "^11.0.0",
"resend": "^3.3.0",
"sharp": "^0.33.3",
"sonner": "^1.4.41",
"sonner": "^1.5.0",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7",
"three": "^0.164.1",
Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/EmailForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useState, ChangeEvent, FormEvent } from "react";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
import { Card, CardHeader, CardTitle, CardDescription, CardContent } from "@/components/ui/card";
import { toast } from "sonner";
import { toast} from "sonner";

interface EmailFormProps {
url: string;
Expand Down Expand Up @@ -37,7 +37,7 @@ export default function EmailForm({ url }: EmailFormProps) {
};

const isValidEmail = (email: string) => {
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
return /^([A-Z0-9a-z._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z]{2,63})+)@(?![-])([a-zA-Z]{2,63})(?:\.[a-zA-Z]{2,63})+$/.test(email); // updated regex to verify approved domains
};

const handleSendEmails = async () => {
Expand Down

0 comments on commit 7839611

Please sign in to comment.