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

@@ -9,11 +9,10 @@ import {
} from '../models/User.js';
import { getDataService } from '../services/services.js';
import { DataService } from '../services/dataService.js';
import { JWT_SECRET } from '../config/jwt.js';
const dataService: DataService = getDataService();
// Default secret key - in production, use an environment variable
const JWT_SECRET = process.env.JWT_SECRET || 'your-secret-key-change-this';
const TOKEN_EXPIRY = '24h';
// Login user