From 275c1c55f4ad6e16db59d536eadc197220b2f93d Mon Sep 17 00:00:00 2001 From: kiyeong Date: Sat, 16 Nov 2024 02:27:46 +0900 Subject: [PATCH] feat: https to http --- index.html | 4 ++++ src/routes/TokenRouter.tsx | 18 ++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 95685cb..aa9039d 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,10 @@ rel="stylesheet" /> + { - -const location = useLocation(); + const location = useLocation(); const navigate = useNavigate(); - const isAuthPath = location.pathname === "/login" || location.pathname === "/signup"; - - - useEffect(() => { - if(!localStorage.getItem("accessToken") && !isAuthPath){ + const isAuthPath = + location.pathname === "/login" || location.pathname === "/signup"; + + useEffect(() => { + if (!localStorage.getItem("accessToken") && !isAuthPath) { navigate("/login"); } - }, [location.pathname, isAuthPath, navigate]); return (
- +
); };