diff --git a/src/app/auth/emailVerification.tsx b/src/app/auth/emailVerification.tsx index b0a3cb3..d8d80a9 100644 --- a/src/app/auth/emailVerification.tsx +++ b/src/app/auth/emailVerification.tsx @@ -63,14 +63,23 @@ const EmailVerification: React.FC = () => { console.log("Parsed response data:", data); if (res.ok && (data as unknown as VerificationResponse)?.success) { - router.replace("/signin?verified=true"); + setStatus("success"); + setMessage("Email verified successfully! Redirecting to login..."); + // Use window.location.href for a hard redirect to ensure it works + setTimeout(() => { + window.location.href = "/signin?verified=true"; + }, 1500); return; } const msg = String(data?.message || "").toLowerCase(); if (msg.includes("already verified")) { - // Check if there's a redirect URL in the response for already verified case too - router.replace("/signin?verified=true"); + setStatus("success"); + setMessage("Email already verified! Redirecting to login..."); + // Use window.location.href for a hard redirect to ensure it works + setTimeout(() => { + window.location.href = "/signin?verified=true"; + }, 1500); return; } @@ -137,7 +146,13 @@ const EmailVerification: React.FC = () => {
{message || "Email verified. Redirecting..."}
+You will be redirected to the login page shortly.