diff --git a/app/auth/register/page.tsx b/app/auth/register/page.tsx index f362eedb..ba17d23a 100644 --- a/app/auth/register/page.tsx +++ b/app/auth/register/page.tsx @@ -24,6 +24,8 @@ import { MousePointer2, Fingerprint, } from "lucide-react"; +import { getActivityDescription, useAuthRouteProtection } from "@/lib/auth-utils"; +import AuthLoader from "@/components/auth/AuthLoader"; export default function Register() { const [name, setName] = useState(""); @@ -38,6 +40,7 @@ export default function Register() { const [focusedField, setFocusedField] = useState(null); const router = useRouter(); const { toast } = useToast(); + const { shouldRedirect, loading } = useAuthRouteProtection(); // Animation mount effect useEffect(() => { @@ -156,7 +159,9 @@ export default function Register() { confirmPassword.trim() && password === confirmPassword && password.length >= 6; - + if (loading || shouldRedirect) { + return ; + } return (
{/* Enhanced background elements with parallax effect */} @@ -176,9 +181,8 @@ export default function Register() { />
{/* Enhanced card with advanced glass effect and magnetic cursor */}
@@ -205,11 +209,10 @@ export default function Register() {
{/* Enhanced header with advanced animations */}
{/* Professional badge with hover effects */}
@@ -236,24 +239,21 @@ export default function Register() {
{/* Enhanced Name field with advanced interactions */}
{/* Enhanced Email field with validation animations */}
{/* Progress indicator */}
0 ? "w-full bg-gradient-to-r from-red-400 to-orange-500" : email - ? "w-1/2 bg-gradient-to-r from-yellow-400 to-blue-500" + ? "w-1/2" : "w-0" }`} >
@@ -370,26 +365,23 @@ export default function Register() { {/* Enhanced Password field with strength indicator */}
@@ -440,26 +431,24 @@ export default function Register() { {[...Array(5)].map((_, i) => (
))}

{passwordStrength < 2 && "Weak password"} {passwordStrength >= 2 && @@ -473,26 +462,23 @@ export default function Register() { {/* Enhanced Confirm Password field with advanced validation */}

@@ -576,11 +559,10 @@ export default function Register() { {/* Enhanced submit button with advanced animations */}
{/* Progress indicator */}
= 6 + className={`absolute bottom-0 left-0 h-0.5 bg-gradient-to-r from-yellow-400 to-blue-500 transition-all duration-300 ${password && password.length >= 6 ? "w-full" : password - ? "w-1/2" - : "w-0" - }`} + ? "w-1/2" + : "w-0" + }`} >
{/* Enhanced submit button with advanced animations */}