From 04f94fb497e15f3c71718578d3c3fdf7e054bb19 Mon Sep 17 00:00:00 2001 From: Joywin Bennis <107112207+joywin2003@users.noreply.github.com> Date: Fri, 13 Sep 2024 00:16:49 +0530 Subject: [PATCH] Refactor: Remove unused code for email verification page --- src/app/verify-email/page.tsx | 62 ----------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 src/app/verify-email/page.tsx diff --git a/src/app/verify-email/page.tsx b/src/app/verify-email/page.tsx deleted file mode 100644 index 0892bd4..0000000 --- a/src/app/verify-email/page.tsx +++ /dev/null @@ -1,62 +0,0 @@ -"use client"; - -import getErrorMessage from "@/utils/getErrorMessage"; -import axios from "axios"; -import Link from "next/link"; -import { useSearchParams } from "next/navigation"; -import React, { useEffect, useState } from "react"; -import { sendEmail } from "@/utils/sendMail"; - -export default function VerifyEmailPage() { - const searchParams = useSearchParams(); - const [token, setToken] = useState(""); - const [verified, setVerified] = useState(false); - const [error, setError] = useState(false); - - const verifyUserEmail = async () => { - try { - await axios.post("/api/users/verify-email", { token }); - setVerified(true); - } catch (error: unknown) { - setError(true); - console.log(getErrorMessage(error)); - } - }; - - useEffect(() => { - const urlToken = searchParams.get("token"); - setToken(urlToken || ""); - }, [searchParams]); - - useEffect(() => { - if (token.length > 0) { - verifyUserEmail(); - } - }, [token]); - - return ( -
You can now proceed to login.
- {/* */} -- There was an error verifying your email. Please try again later. -
-