From d380f81ff8f1992f7d1a474ffb9bbe03ae167f8e Mon Sep 17 00:00:00 2001 From: Alexander Borg Date: Tue, 19 Aug 2025 21:22:58 +0200 Subject: [PATCH] Fix jwt-token --- server/utils/apiDebugLogger.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/utils/apiDebugLogger.js b/server/utils/apiDebugLogger.js index 3818430..de324cd 100644 --- a/server/utils/apiDebugLogger.js +++ b/server/utils/apiDebugLogger.js @@ -84,10 +84,11 @@ class ApiDebugLogger { if (!this.enabled) return; const timestamp = new Date().toISOString(); - const logEntry = `[${timestamp}] INCOMING ${req.method} ${req.url} - BODY:${JSON.stringify(this.sanitizeData(req.body))} - HEADERS:${JSON.stringify(this.sanitizeHeaders(req.headers))}`; + const fullUrl = req.originalUrl || req.url; + const logEntry = `[${timestamp}] INCOMING ${req.method} ${fullUrl} - BODY:${JSON.stringify(this.sanitizeData(req.body))} - HEADERS:${JSON.stringify(this.sanitizeHeaders(req.headers))}`; // Always log to console - console.log(`🐛 API Request: ${req.method} ${req.url}`); + console.log(`🐛 API Request: ${req.method} ${fullUrl}`); // Try to log to file if enabled if (this.fileLoggingEnabled) { @@ -103,9 +104,10 @@ class ApiDebugLogger { logResponse(req, res, responseBody) { if (!this.enabled) return; + const fullUrl = req.originalUrl || req.url; this.log( req.method, - req.url, + fullUrl, res.statusCode, req.body, responseBody,