We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf62308 commit d5764f5Copy full SHA for d5764f5
packages/backend/src/routes/api/index.ts
@@ -1,9 +1,18 @@
1
import { Router } from 'express'
2
3
+import {
4
+ requireAuthentication,
5
+ setCurrentUserContext,
6
+} from './middleware/authentication'
7
import chatRouter from './chat'
8
9
const router = Router()
10
11
+// Apply authentication middleware to ALL API routes
12
+// This mirrors how GraphQL handles authentication via context
13
+router.use(setCurrentUserContext)
14
+router.use(requireAuthentication)
15
+
16
// Mount individual API routes
17
router.use('/chat', chatRouter)
18
0 commit comments