issue # 로그인 페이지 라우팅

This commit is contained in:
민건희
2025-11-10 23:08:33 +09:00
parent ca1ebd2985
commit a51566ffae
4 changed files with 53 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ import Layout from './layouts/Layout';
import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom';
import { useAuthStore } from './store/authStore';
import { PageRouting } from './data/RoutingData';
import LoginPage from './ui/page/login/LoginPage';
function App() {
const { authData } = useAuthStore();
@@ -15,8 +16,9 @@ function App() {
<Router>
<Routes>
<Route element={<Layout />}>
<Route element={<LoginPage />} path={PageRouting["LOGIN"].path} />
<Route element={<SignUpPage />} path={PageRouting["SIGN_UP"].path} />
{!(authData?.isLogedIn) ? <Route element={<Navigate to={`/${PageRouting["SIGN_UP"].path}`} />} path="*" /> : null}
{!(authData?.isLogedIn) ? <Route element={<Navigate to={`/${PageRouting["LOGIN"].path}`} />} path="*" /> : null}
</Route>
</Routes>
</Router>