Skip to content

Commit d3ba1ad

Browse files
committed
Hotfix: 배포페이지에서 새로고침 시 루트 페이지가 보이는 오류 해결
1 parent 1459050 commit d3ba1ad

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/app/routes/components/protected-route/ProtectedRoute.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { useState, useEffect } from 'react';
21
import { Navigate, Outlet } from 'react-router-dom';
32

43
import { RouterPath } from '../../path';
@@ -11,18 +10,9 @@ type Props = {
1110
};
1211

1312
const ProtectedRoute = ({ requiresAuth, sinittoOnly, guardOnly }: Props) => {
14-
const [isAuthLoading, setIsAuthLoading] = useState(true);
1513
const accessToken = authStorage.accessToken.get();
1614
const isSinitto = authStorage.isSinitto.get() === 'true';
1715

18-
useEffect(() => {
19-
setIsAuthLoading(false);
20-
}, [accessToken, isSinitto]);
21-
22-
if (isAuthLoading) {
23-
return <></>;
24-
}
25-
2616
if (requiresAuth && !accessToken) {
2717
return <Navigate to={RouterPath.ROOT} />;
2818
}

src/pages/common/onboard/ui/OnboardPage.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export const OnboardPage = () => {
1717
setPage(swiper.activeIndex);
1818
};
1919

20+
if (window.location.pathname !== '/') return null;
21+
2022
return (
2123
<MainPageLayout page={page}>
2224
<Wrapper>

0 commit comments

Comments
 (0)