Skip to content

Commit

Permalink
🔒 protect calendar route
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlanshoesmith committed Dec 15, 2024
1 parent cb90abf commit 3cfd919
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,17 @@ function App() {
<Routes>
<Route path="/" element={<HomePage />} />
<Route path="/about" element={<AboutPage />} />
<Route path="/timeline" element={<Calendar />} /> //
<Route
path="/timeline"
element={
<ProtectedRoute
isAuthenticated={user !== null && user.id !== undefined}
fallback={<Navigate to="/login" />}
>
<Calendar />
</ProtectedRoute>
}
/>
<Route
path="/login"
element={
Expand Down

0 comments on commit 3cfd919

Please sign in to comment.