diff --git a/src/App.tsx b/src/App.tsx index fb12b10..0c105cb 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -22,7 +22,6 @@ import ChallengeCommunityPage from './pages/ChallengeCommunityPage'; import CreateChallengePage from './pages/CreateChallengePage'; import ChallengeDetailPage from './pages/ChallengeDetailPage'; import TutorialPage from './pages/TutorialPage'; -import ErrorPage from './pages/ErrorPage'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; @@ -34,6 +33,8 @@ import 'react-toastify/dist/ReactToastify.css'; import './App.css'; import { useSSE } from './hooks/useSSE'; import ProtectedRoute from './components/ProtectedRoute'; +import Error404Page from './pages/Error404Page'; +import Error403Page from './pages/Error403Page'; const queryClient = new QueryClient(); @@ -76,7 +77,8 @@ const router = (isLoggedIn: boolean) => {/* 로그인 상관없이 접근 가능한 라우터. 보호되지 않는 라우터 */} } /> - } /> + } /> + } /> {/* 보호된 경로들에 ProtectedRoute 적용 */} { + const navigate = useNavigate(); + + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {/* ERROR */} + + 죄송합니다. 해당 대시보드에 접근할 권한이 없습니다. + + navigate('/')}>뒤로가기 + + ); +}; + +export default Error403Page; diff --git a/src/pages/ErrorPage.tsx b/src/pages/Error404Page.tsx similarity index 99% rename from src/pages/ErrorPage.tsx rename to src/pages/Error404Page.tsx index 52e642f..e0d6a8a 100644 --- a/src/pages/ErrorPage.tsx +++ b/src/pages/Error404Page.tsx @@ -7,7 +7,7 @@ const ErrorPage = () => { return ( - {/* { - */} + 404 ERROR