fix(auth): redact passwords on normalized login paths
CI / changes (pull_request) Canceled after 0s
CI / server (pull_request) Canceled after 0s
CI / client (pull_request) Canceled after 0s
CI / image (pull_request) Canceled after 0s

- Normalize login paths before applying request-body redaction.
- Cover trailing-slash paths and assert the password never reaches logs.
This commit is contained in:
agent committed 2026-11-04 15:59:49 -05:00
1 parent de41571b5c
commit 72e127888c
2 files changed
+50 -2

No files matched your search

@@ -9,8 +9,10 @@ import { Observable, tap } from "rxjs";
import { TraceLogger } from "../common/trace-logger";
export function redactAuthRequestBody(path: string, body: unknown): unknown {
const normalizedPath = path.toLowerCase().replace(/\/+$/, "");
if (
!/^(?:\/api\/v1)?\/auth\/login$/.test(path) ||
(normalizedPath !== "/auth/login" &&
normalizedPath !== "/api/v1/auth/login") ||
!body ||
typeof body !== "object" ||
Array.isArray(body)