Fix jwt-token
This commit is contained in:
@@ -84,10 +84,11 @@ class ApiDebugLogger {
|
|||||||
if (!this.enabled) return;
|
if (!this.enabled) return;
|
||||||
|
|
||||||
const timestamp = new Date().toISOString();
|
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
|
// 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
|
// Try to log to file if enabled
|
||||||
if (this.fileLoggingEnabled) {
|
if (this.fileLoggingEnabled) {
|
||||||
@@ -103,9 +104,10 @@ class ApiDebugLogger {
|
|||||||
logResponse(req, res, responseBody) {
|
logResponse(req, res, responseBody) {
|
||||||
if (!this.enabled) return;
|
if (!this.enabled) return;
|
||||||
|
|
||||||
|
const fullUrl = req.originalUrl || req.url;
|
||||||
this.log(
|
this.log(
|
||||||
req.method,
|
req.method,
|
||||||
req.url,
|
fullUrl,
|
||||||
res.statusCode,
|
res.statusCode,
|
||||||
req.body,
|
req.body,
|
||||||
responseBody,
|
responseBody,
|
||||||
|
|||||||
Reference in New Issue
Block a user