frontend changes

This commit is contained in:
Chandini 2025-09-19 11:06:48 +05:30
parent 6baf9080a7
commit da85ce0f54
2 changed files with 19 additions and 4 deletions

View File

@ -63,14 +63,23 @@ const EmailVerification: React.FC = () => {
console.log("Parsed response data:", data); console.log("Parsed response data:", data);
if (res.ok && (data as unknown as VerificationResponse)?.success) { 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; return;
} }
const msg = String(data?.message || "").toLowerCase(); const msg = String(data?.message || "").toLowerCase();
if (msg.includes("already verified")) { if (msg.includes("already verified")) {
// Check if there's a redirect URL in the response for already verified case too setStatus("success");
router.replace("/signin?verified=true"); 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; return;
} }
@ -137,7 +146,13 @@ const EmailVerification: React.FC = () => {
<div className="max-w-md w-full space-y-6"> <div className="max-w-md w-full space-y-6">
{status === "success" && ( {status === "success" && (
<div className="bg-green-50 border border-green-200 rounded-md p-4 text-center"> <div className="bg-green-50 border border-green-200 rounded-md p-4 text-center">
<div className="flex items-center justify-center mb-2">
<svg className="w-6 h-6 text-green-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
</svg>
</div>
<p className="text-green-800 font-medium">{message || "Email verified. Redirecting..."}</p> <p className="text-green-800 font-medium">{message || "Email verified. Redirecting..."}</p>
<p className="text-green-600 text-sm mt-1">You will be redirected to the login page shortly.</p>
</div> </div>
)} )}

View File

@ -2,7 +2,7 @@
// //
export const BACKEND_URL = 'https://backend.codenuk.com'; export const BACKEND_URL = 'https://backend.codenuk.com';
// export const BACKEND_URL = 'http://localhost:8000'; // export const BACKEND_URL = 'http://192.168.1.16:8000';
export const SOCKET_URL = BACKEND_URL; export const SOCKET_URL = BACKEND_URL;