From c8e98ffa0d0eb8ed2adbbae8d56464712a1e39cf Mon Sep 17 00:00:00 2001 From: Zac Gaetano Date: Wed, 27 May 2026 19:08:07 -0400 Subject: [PATCH] =?UTF-8?q?fix(auth):=20sync=20DEV=5FUSER=5FID=20with=20mi?= =?UTF-8?q?gration=20023=20=E2=80=94=20use=20all-zeros=20UUID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Migration 023 was fixed in 9dc572b to use '00000000-0000-4000-8000-000000000000' because 'v' isn't a valid hex digit, but the DEV_USER_ID constant in middleware/auth.js still referenced the original '...000000000dev'. Every route that passes DEV_USER_ID as a query parameter (users list, login lookup, setup-required count) was throwing 22P02 invalid input syntax for type uuid. The errors were swallowed by Promise.allSettled in the SPA's data load so the app appeared to work in dev mode, but enabling AUTH_ENABLED=true would have broken login entirely. --- services/mam-api/src/middleware/auth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/mam-api/src/middleware/auth.js b/services/mam-api/src/middleware/auth.js index 2e5707a..374aacf 100644 --- a/services/mam-api/src/middleware/auth.js +++ b/services/mam-api/src/middleware/auth.js @@ -3,7 +3,7 @@ import { parseBearer, hashToken } from '../auth/tokens.js'; // Stable UUID matching migration 023's seeded dev user. /** UUID of the seeded dev-mode placeholder. NOT a sentinel for "any unauthenticated user". */ -export const DEV_USER_ID = '00000000-0000-4000-8000-000000000dev'; +export const DEV_USER_ID = '00000000-0000-4000-8000-000000000000'; export const DEV_USER = { id: DEV_USER_ID, username: 'dev', display_name: 'Dev (AUTH_ENABLED=false)' }; const ABSOLUTE_MS = 8 * 3600 * 1000;