feat(auth): protect Collab, Community Q&A, and Leetcode routes behind Google Sign-In
Some checks failed
Deploy RIT Freshers Hub to VPS / Deploy to Live VPS (push) Has been cancelled
Some checks failed
Deploy RIT Freshers Hub to VPS / Deploy to Live VPS (push) Has been cancelled
This commit is contained in:
40
src/App.tsx
40
src/App.tsx
@@ -2,6 +2,7 @@ import { useEffect } from 'react';
|
||||
import { BrowserRouter, Routes, Route, useLocation } from 'react-router-dom';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { AuthProvider } from '@/context/AuthContext';
|
||||
import ProtectedRoute from '@/components/Auth/ProtectedRoute';
|
||||
import MainLayout from '@/layouts/MainLayout';
|
||||
import Home from '@/pages/Home/Home';
|
||||
import Notes from '@/pages/Notes/Notes';
|
||||
@@ -48,9 +49,42 @@ function App() {
|
||||
<Route path="/bus-routes" element={<BusRoutes />} />
|
||||
<Route path="/faculty" element={<Faculty />} />
|
||||
<Route path="/events" element={<Events />} />
|
||||
<Route path="/community" element={<Community />} />
|
||||
<Route path="/collab" element={<DevCollab />} />
|
||||
<Route path="/leetcode" element={<LeetcodeLeaderboard />} />
|
||||
|
||||
{/* Protected Routes — Require Google Sign-In */}
|
||||
<Route
|
||||
path="/community"
|
||||
element={
|
||||
<ProtectedRoute
|
||||
title="RIT Q&A Community"
|
||||
description="Connect with fellow RIT students and ask senior helpers any question about campus life and academics."
|
||||
>
|
||||
<Community />
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path="/collab"
|
||||
element={
|
||||
<ProtectedRoute
|
||||
title="Developer Collab Hub"
|
||||
description="Post open-source projects, search for co-developers, and connect with fellow programmers."
|
||||
requireVerifiedStudent={true}
|
||||
>
|
||||
<DevCollab />
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path="/leetcode"
|
||||
element={
|
||||
<ProtectedRoute
|
||||
title="RIT LeetCode Leaderboard"
|
||||
description="Track campus competitive programming rankings and see top RIT coders."
|
||||
>
|
||||
<LeetcodeLeaderboard />
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
</Route>
|
||||
</Routes>
|
||||
</AuthProvider>
|
||||
|
||||
Reference in New Issue
Block a user