Skip to content

Commit 1fda0a0

Browse files
committedDec 26, 2023
Enhance route protection for authenticated users in App component
1 parent 247a6a3 commit 1fda0a0

File tree

10,868 files changed

+1466302
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

10,868 files changed

+1466302
-8
lines changed
 

‎client/src/App.js

+13-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,19 @@ function App() {
2020
<ThemeProvider theme={theme}>
2121
<CssBaseline />
2222
<Routes>
23-
<Route path="/*" element={<LoginPage/>}/>
24-
<Route path="/home" element={isAuth ? <HomePage/> : <Navigate to ="/"/>}/>
25-
<Route path="/profile/:userId" element={isAuth ? <ProfilePage/> : <Navigate to ="/"/>}/>
23+
{/* <Route path="/*" element={<LoginPage/>}/> */}
24+
<Route
25+
path="/*"
26+
element={isAuth ? <Navigate to ="/home"/> : <LoginPage/>}
27+
/>
28+
{/* <Route path="/home" element={isAuth ? <HomePage/> : <Navigate to ="/"/>}/> */}
29+
<Route
30+
path="/home"
31+
element={isAuth ? <HomePage/> : <Navigate to ="/"/>}
32+
/>
33+
<Route
34+
path="/profile/:userId"
35+
element={isAuth ? <ProfilePage/> : <Navigate to ="/"/>}/>
2636
</Routes>
2737
</ThemeProvider>
2838
</BrowserRouter>

‎node_modules/.bin/loose-envify

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.