Fix navigation for logged-out users
Fixes a bug where clicking on Profile Management, Notification Settings, or Security & Privacy in Settings while logged out resulted in a 404 error.
This commit is contained in:
38
src/App.tsx
38
src/App.tsx
@@ -1,4 +1,3 @@
|
||||
|
||||
import React from 'react';
|
||||
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
|
||||
import './App.css';
|
||||
@@ -19,6 +18,7 @@ import Analytics from './pages/Analytics';
|
||||
import PaymentMethods from './pages/PaymentMethods';
|
||||
import Settings from './pages/Settings';
|
||||
import { BudgetProvider } from './contexts/BudgetContext';
|
||||
import PrivateRoute from './components/auth/PrivateRoute';
|
||||
|
||||
// 전역 오류 핸들러
|
||||
const handleError = (error: any) => {
|
||||
@@ -83,15 +83,39 @@ function App() {
|
||||
<Route path="/" element={<Index />} />
|
||||
<Route path="/login" element={<Login />} />
|
||||
<Route path="/register" element={<Register />} />
|
||||
<Route path="/profile" element={<ProfileManagement />} />
|
||||
<Route path="/profile" element={
|
||||
<PrivateRoute>
|
||||
<ProfileManagement />
|
||||
</PrivateRoute>
|
||||
} />
|
||||
<Route path="/settings" element={<Settings />} />
|
||||
<Route path="/transactions" element={<Transactions />} />
|
||||
<Route path="/security-privacy" element={<SecurityPrivacySettings />} />
|
||||
<Route path="/notifications" element={<NotificationSettings />} />
|
||||
<Route path="/transactions" element={
|
||||
<PrivateRoute>
|
||||
<Transactions />
|
||||
</PrivateRoute>
|
||||
} />
|
||||
<Route path="/security-privacy" element={
|
||||
<PrivateRoute>
|
||||
<SecurityPrivacySettings />
|
||||
</PrivateRoute>
|
||||
} />
|
||||
<Route path="/notifications" element={
|
||||
<PrivateRoute>
|
||||
<NotificationSettings />
|
||||
</PrivateRoute>
|
||||
} />
|
||||
<Route path="/help-support" element={<HelpSupport />} />
|
||||
<Route path="/forgot-password" element={<ForgotPassword />} />
|
||||
<Route path="/analytics" element={<Analytics />} />
|
||||
<Route path="/payment-methods" element={<PaymentMethods />} />
|
||||
<Route path="/analytics" element={
|
||||
<PrivateRoute>
|
||||
<Analytics />
|
||||
</PrivateRoute>
|
||||
} />
|
||||
<Route path="/payment-methods" element={
|
||||
<PrivateRoute>
|
||||
<PaymentMethods />
|
||||
</PrivateRoute>
|
||||
} />
|
||||
<Route path="*" element={<NotFound />} />
|
||||
</Routes>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user