From 5dd09d20aa4003192fa3c4615963d9aa5cf3a070 Mon Sep 17 00:00:00 2001 From: malayathigeetha Date: Fri, 3 Oct 2025 11:37:27 +0530 Subject: [PATCH] Added solution for issue 135 --- client/src/pages/HomePage.jsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/src/pages/HomePage.jsx b/client/src/pages/HomePage.jsx index 2782330..48bffcd 100644 --- a/client/src/pages/HomePage.jsx +++ b/client/src/pages/HomePage.jsx @@ -20,6 +20,15 @@ const HomePage = () => { const [movingBlobs, setMovingBlobs] = useState([]); const containerRef = useRef(null); + + useEffect(() => { + const token = localStorage.getItem("token"); + const user = localStorage.getItem("user"); + if (token && user) { + navigate("/landing", { replace: true }); + } + }, [navigate]); + const getRandomChar = () => { const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*"; return chars.charAt(Math.floor(Math.random() * chars.length));