Fix jwt-token
This commit is contained in:
@@ -71,37 +71,13 @@ class ApiDebugLogger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sanitizeData(data) {
|
sanitizeData(data) {
|
||||||
if (!data || typeof data !== 'object') return data;
|
// For debugging, return data as-is without redaction
|
||||||
|
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sanitizeHeaders(headers) {
|
sanitizeHeaders(headers) {
|
||||||
if (!headers || typeof headers !== 'object') return {};
|
// For debugging, return headers as-is without redaction
|
||||||
|
return headers;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logRequest(req) {
|
logRequest(req) {
|
||||||
|
|||||||
Reference in New Issue
Block a user