mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-07 19:10:12 +08:00
feat: update frontend to use cookie session
* use SessionMiddleware in socket.io server * add back jwtStrategy for commands
This commit is contained in:
1 parent
be5cd152a9
commit
34c277c886
13 files changed
+90
-116
No files matched your search
+4
-2
@@ -3,6 +3,7 @@ import express from 'express'
|
||||
import http from 'http'
|
||||
import YAML from 'yaml'
|
||||
import swaggerUI from 'swagger-ui-express'
|
||||
import passport from 'passport'
|
||||
|
||||
import './auth/passport.js'
|
||||
import socketServer from './api/socket.js'
|
||||
@@ -16,7 +17,7 @@ import expiryRemovalScheduler from './containers/expiryChecker.js'
|
||||
import { createTestUser } from './utils/auth.js'
|
||||
|
||||
async function main() {
|
||||
const db = await connectDB()
|
||||
await connectDB()
|
||||
|
||||
await createTestUser()
|
||||
|
||||
@@ -30,7 +31,8 @@ async function main() {
|
||||
const server = http.createServer(app)
|
||||
socketServer(server)
|
||||
app.use(errorHandler)
|
||||
app.use(sessionMiddleware(db))
|
||||
app.use(sessionMiddleware)
|
||||
app.use(passport.session())
|
||||
app.use(
|
||||
'/api-docs',
|
||||
swaggerUI.serve,
|
||||
|
||||
Reference in new issue
Block a user