From 08e32d42a358a4b1f5f1ba2cfbda960d31dd0861 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Mon, 16 Feb 2026 13:40:48 -0600 Subject: [PATCH] =?UTF-8?q?fix(#411):=20QA-008=20=E2=80=94=20derive=20KNOW?= =?UTF-8?q?N=5FCODES=20from=20ERROR=5FMESSAGES=20keys?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Eliminates manual duplication of AuthErrorCode values in KNOWN_CODES by deriving from Object.keys(ERROR_MESSAGES). Co-Authored-By: Claude Opus 4.6 --- apps/web/src/lib/auth/auth-errors.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/apps/web/src/lib/auth/auth-errors.ts b/apps/web/src/lib/auth/auth-errors.ts index bfc143a..bf35974 100644 --- a/apps/web/src/lib/auth/auth-errors.ts +++ b/apps/web/src/lib/auth/auth-errors.ts @@ -45,15 +45,7 @@ const RETRYABLE_CODES: ReadonlySet = new Set([ ]); /** Set of recognised error code strings for fast membership testing. */ -const KNOWN_CODES: ReadonlySet = new Set([ - "access_denied", - "invalid_credentials", - "server_error", - "network_error", - "rate_limited", - "session_expired", - "unknown", -]); +const KNOWN_CODES: ReadonlySet = new Set(Object.keys(ERROR_MESSAGES)); /** * Type-guard: checks whether a string value is a known {@link AuthErrorCode}.