fix(housekeeping): preserve audit failure evidence

This commit is contained in:
Simo committed 2026-08-26 22:03:02 +02:00
1 parent 89dec9da05
commit 21cd88ccfd
4 files changed
+80 -5

No files matched your search

+4 -3
View File
@@ -30,7 +30,8 @@ const SENSITIVE_KEY_RE =
const REDACTED = "[Redacted]";
function sanitizeAuditPayload(value: unknown, depth = 0): unknown {
if (depth > 6 || value == null) return value;
if (depth > 6) return REDACTED;
if (value == null) return value;
if (Array.isArray(value))
return value.map((v) => sanitizeAuditPayload(v, depth + 1));
if (typeof value !== "object") return value;
@@ -108,8 +109,8 @@ export async function getAuditLogs(options: GetLogsOptions = {}) {
const where = search
? or(
like(AdminAuditLog.action, `%${search}%`),
like(AdminAuditLog.target, `%${search}%`),
like(AdminAuditLog.action, `%$search%`),
like(AdminAuditLog.target, `%$search%`),
)
: undefined;