refactor(audit): unify computerName source to cached os.hostname()

Export cachedHostname from audit-logger and use it in process-guards,
replacing process.env.COMPUTERNAME so all audit entries use the same value.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka
2026-04-06 17:41:36 +08:00
parent abad61758c
commit 91f29a1167
2 changed files with 4 additions and 4 deletions

View File

@@ -102,7 +102,7 @@ export function logAudit(
}
/** Cached hostname — invariant for the app lifecycle */
const cachedHostname = hostname()
export const cachedHostname = hostname()
/**
* Audit log shortcut that auto-resolves the current user context.