diff --git a/apps/mail/.env.example b/apps/mail/.env.example index f19beaa94..30da961f0 100644 --- a/apps/mail/.env.example +++ b/apps/mail/.env.example @@ -3,11 +3,11 @@ NEXT_PUBLIC_APP_URL=http://localhost:3000 DATABASE_URL="postgresql://postgres:postgres@localhost:5432/mail0" # Change this to a random string, use `openssl rand -hex 32` to generate a 32 character string -BETTER_AUTH_SECRET=my-better-auth-secret +BETTER_AUTH_SECRET=my-better-auth-secret BETTER_AUTH_URL=http://localhost:3000 BETTER_AUTH_TRUSTED_ORIGINS=http://localhost:3000 -# Change to your project's client ID and secret, these work with localhost:3000 and localhost:3001 +# Change to your project's client ID and secret, these work with localhost:3000 and localhost:3001 GOOGLE_CLIENT_ID= GOOGLE_CLIENT_SECRET= GOOGLE_REDIRECT_URI=http://localhost:3000/api/v1/mail/auth/google/callback @@ -22,5 +22,4 @@ REDIS_URL="http://localhost:8079" REDIS_TOKEN="upstash-local-token" # Resend API Key -RESEND_API_KEY= -NEXT_PUBLIC_TURNSTILE_SITE_KEY= \ No newline at end of file +RESEND_API_KEY= \ No newline at end of file diff --git a/apps/mail/app/api/auth/early-access/route.ts b/apps/mail/app/api/auth/early-access/route.ts index 1b4d81ab9..86b0c0fee 100644 --- a/apps/mail/app/api/auth/early-access/route.ts +++ b/apps/mail/app/api/auth/early-access/route.ts @@ -15,8 +15,6 @@ const ratelimit = new Ratelimit({ analytics: true, prefix: "ratelimit:early-access", }); -const verifyEndpoint = 'https://challenges.cloudflare.com/turnstile/v0/siteverify' -const secret = process.env.TURNSTILE_SECRET_KEY! export async function POST(req: NextRequest) { try { @@ -41,28 +39,13 @@ export async function POST(req: NextRequest) { const body = await req.json(); console.log("Request body:", body); - const { email, token } = body; + const { email } = body; if (!email) { console.log("Email missing from request"); return NextResponse.json({ error: "Email is required" }, { status: 400 }); } - const verifyRequest = await fetch(verifyEndpoint, { - method: 'POST', - body: `secret=${encodeURIComponent(secret)}&response=${encodeURIComponent(token)}&remoteip=${ip}`, - headers: { - 'content-type': 'application/x-www-form-urlencoded' - } - }) - - const verifyResponse = await verifyRequest.json() - - if (!verifyResponse.success) { - console.warn("Turnstile verification failed:", verifyResponse.error) - return NextResponse.json({ error: "Invalid turnstile verification" }, { status: 400 }); - } - const nowDate = new Date(); try { diff --git a/apps/mail/components/home/hero.tsx b/apps/mail/components/home/hero.tsx index 4349c8a2c..8ecc38434 100644 --- a/apps/mail/components/home/hero.tsx +++ b/apps/mail/components/home/hero.tsx @@ -2,7 +2,6 @@ import { Form, FormControl, FormField, FormItem } from "../ui/form"; import { AnimatedNumber } from "../ui/animated-number"; -import { Turnstile } from "@marsidev/react-turnstile"; import { zodResolver } from "@hookform/resolvers/zod"; import { Card, CardContent } from "../ui/card"; import { useState, useEffect } from "react"; @@ -25,7 +24,6 @@ export default function Hero() { const [isSubmitting, setIsSubmitting] = useState(false); const [showSuccess, setShowSuccess] = useState(false); const [signupCount, setSignupCount] = useState(0); - const [token, setToken] = useState(); const form = useForm>({ resolver: zodResolver(betaSignupSchema), @@ -48,16 +46,12 @@ export default function Hero() { }, []); const onSubmit = async (values: z.infer) => { - if (!token) { - return toast.error("Please complete the captcha before submitting"); - } setIsSubmitting(true); try { console.log("Starting form submission with email:", values.email); const response = await axios.post("/api/auth/early-access", { email: values.email, - token, }); console.log("Response data:", response.data); @@ -109,7 +103,7 @@ export default function Hero() { We'll let you know when we're ready to revolutionize your email experience.

- ) : process.env.NODE_ENV === "development" ? ( + ) : process.env.NODE_ENV !== "development" ? (