Fix jwt-token

This commit is contained in:
2025-08-19 20:24:24 +02:00
parent 733564fd70
commit 6fd3c0fe3f

View File

@@ -3,7 +3,7 @@ const path = require('path');
class ApiDebugLogger {
constructor() {
this.logFile = path.join(__dirname, '..', '..', 'api_debug.log');
this.logFile = path.join(__dirname, '..', 'logs', 'api_debug.log');
this.enabled = process.env.NODE_ENV === 'development' || process.env.API_DEBUG === 'true';
// Debug logging setup
@@ -11,8 +11,14 @@ class ApiDebugLogger {
console.log(`🐛 ApiDebugLogger: Enabled (NODE_ENV=${process.env.NODE_ENV}, API_DEBUG=${process.env.API_DEBUG})`);
console.log(`🐛 ApiDebugLogger: Log file path: ${this.logFile}`);
// Ensure the log file exists
// Ensure the logs directory exists
try {
const logsDir = path.dirname(this.logFile);
if (!fs.existsSync(logsDir)) {
fs.mkdirSync(logsDir, { recursive: true });
console.log(`🐛 ApiDebugLogger: Created logs directory at ${logsDir}`);
}
if (!fs.existsSync(this.logFile)) {
fs.writeFileSync(this.logFile, `# API Debug Log Started at ${new Date().toISOString()}\n`);
console.log(`🐛 ApiDebugLogger: Created log file at ${this.logFile}`);