Overview
axios.config.ts logs the full error.response.data object to the console and Sentry. If the response contains passwords, tokens, or PII in error payloads (as some backends inadvertently include), these are logged in plaintext.
Specifications
Features:
- Define a
sanitizeErrorResponse(data: unknown): unknown function that strips sensitive keys
- Apply it before all error logging
Tasks:
- Implement sanitization for keys:
password, token, secret, card, cvv, ssn
- Apply to both console and Sentry logging
- Write tests for sanitization of nested objects
Impacted Files:
src/config/axios.config.ts
src/utils/sanitize.ts (new)
Acceptance Criteria
- Sensitive keys are replaced with
[REDACTED] before logging
- Nested objects are recursively sanitized
- Unit tests cover all sensitive key names
Overview
axios.config.tslogs the fullerror.response.dataobject to the console and Sentry. If the response contains passwords, tokens, or PII in error payloads (as some backends inadvertently include), these are logged in plaintext.Specifications
Features:
sanitizeErrorResponse(data: unknown): unknownfunction that strips sensitive keysTasks:
password,token,secret,card,cvv,ssnImpacted Files:
src/config/axios.config.tssrc/utils/sanitize.ts(new)Acceptance Criteria
[REDACTED]before logging