1
0
mirror of https://github.com/samanhappy/mcphub.git synced 2026-01-11 00:58:20 -05:00

feat: add log management features including log viewing, filtering, and streaming (#45)

This commit is contained in:
samanhappy
2025-05-02 21:41:16 +08:00
committed by GitHub
parent 9b1338a356
commit e5aaae466f
17 changed files with 783 additions and 75 deletions

View File

@@ -6,8 +6,10 @@ const JWT_SECRET = process.env.JWT_SECRET || 'your-secret-key-change-this';
// Middleware to authenticate JWT token
export const auth = (req: Request, res: Response, next: NextFunction): void => {
// Get token from header
const token = req.header('x-auth-token');
// Get token from header or query parameter
const headerToken = req.header('x-auth-token');
const queryToken = req.query.token as string;
const token = headerToken || queryToken;
// Check if no token
if (!token) {