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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user