Refactor JWT secret management and enhance documentation (#270)

This commit is contained in:
samanhappy
2025-08-11 19:09:33 +08:00
committed by GitHub
parent 604fe4f71d
commit 77b423fbcc
8 changed files with 54 additions and 628 deletions

View File

@@ -2,9 +2,7 @@ import { Request, Response, NextFunction } from 'express';
import jwt from 'jsonwebtoken';
import { loadSettings } from '../config/index.js';
import defaultConfig from '../config/index.js';
// Default secret key - in production, use an environment variable
const JWT_SECRET = process.env.JWT_SECRET || 'your-secret-key-change-this';
import { JWT_SECRET } from '../config/jwt.js';
const validateBearerAuth = (req: Request, routingConfig: any): boolean => {
if (!routingConfig.enableBearerAuth) {