From 44aeb676999b736817aa40b61ff91e0db26a854e Mon Sep 17 00:00:00 2001 From: areumH <94692566+areumH@users.noreply.github.com> Date: Thu, 23 Jan 2025 00:40:18 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20ProtectedRoutes=EC=97=90=EC=84=9C?= =?UTF-8?q?=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EC=97=AC=EB=B6=80=EB=A5=BC=20?= =?UTF-8?q?boolean=20=EA=B0=92=EC=9D=B4=20=EC=95=84=EB=8B=8C=20=ED=86=A0?= =?UTF-8?q?=ED=81=B0=20=EA=B0=92=EC=9C=BC=EB=A1=9C=20=ED=99=95=EC=9D=B8?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 4 ++-- src/components/Routes/ProtectedRoutes.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index bdd1a20e..8f178e73 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -49,7 +49,7 @@ const App: React.FC = () => { const navigate = useNavigate(); const isMobile = useIsMobile(); - const isLoggedIn = !!useNewSelector(selectAccessToken); + const accessToken = useNewSelector(selectAccessToken); const isTokenRefreshing = useNewSelector(selectIsRefreshing); useEffect(() => { @@ -96,7 +96,7 @@ const App: React.FC = () => { } /> - }> + }> }> } /> diff --git a/src/components/Routes/ProtectedRoutes.tsx b/src/components/Routes/ProtectedRoutes.tsx index 3cfe6645..126a3b78 100644 --- a/src/components/Routes/ProtectedRoutes.tsx +++ b/src/components/Routes/ProtectedRoutes.tsx @@ -3,11 +3,11 @@ import { PATH } from '@/constants/path'; import { Navigate, Outlet } from 'react-router-dom'; type Props = { - isLoggedIn: boolean; + token: string | undefined; }; -const ProtectedRoutes = ({ isLoggedIn }: Props) => { - return isLoggedIn ? : ; +const ProtectedRoutes = ({ token }: Props) => { + return token ? : ; }; export default ProtectedRoutes;