Fix jwt-token
This commit is contained in:
@@ -71,37 +71,13 @@ class ApiDebugLogger {
|
||||
}
|
||||
|
||||
sanitizeData(data) {
|
||||
if (!data || typeof data !== 'object') return data;
|
||||
|
||||
const sanitized = { ...data };
|
||||
|
||||
// Remove sensitive fields
|
||||
const sensitiveFields = ['password', 'token', 'secret', 'key', 'auth', 'authorization'];
|
||||
|
||||
sensitiveFields.forEach(field => {
|
||||
if (sanitized[field]) {
|
||||
sanitized[field] = '***REDACTED***';
|
||||
}
|
||||
});
|
||||
|
||||
return sanitized;
|
||||
// For debugging, return data as-is without redaction
|
||||
return data;
|
||||
}
|
||||
|
||||
sanitizeHeaders(headers) {
|
||||
if (!headers || typeof headers !== 'object') return {};
|
||||
|
||||
const sanitized = { ...headers };
|
||||
|
||||
// Remove sensitive headers
|
||||
const sensitiveHeaders = ['authorization', 'cookie', 'x-api-key', 'x-auth-token'];
|
||||
|
||||
sensitiveHeaders.forEach(header => {
|
||||
if (sanitized[header]) {
|
||||
sanitized[header] = '***REDACTED***';
|
||||
}
|
||||
});
|
||||
|
||||
return sanitized;
|
||||
// For debugging, return headers as-is without redaction
|
||||
return headers;
|
||||
}
|
||||
|
||||
logRequest(req) {
|
||||
|
||||
Reference in New Issue
Block a user