Consolidate frontend storage keys into constants module

- Move magic strings from AuthProvider, MainLayout, and ThemeProvider to
  frontend/src/utils/constants.ts
- Add STORAGE_KEY_AUTHENTICATED, STORAGE_KEY_SIDEBAR_COLLAPSED, and
  STORAGE_KEY_THEME constants with JSDoc descriptions
- Update all three files to import and use centralized keys
- Prevents key drift and typo regressions across the frontend

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-04-28 09:48:28 +02:00
parent 72c4a0ed04
commit 252204ed97
5 changed files with 29 additions and 31 deletions

View File

@@ -1,21 +1,3 @@
## 21) Silent auth error swallow in fetch error utility
- Where found:
- [frontend/src/utils/fetchError.ts](frontend/src/utils/fetchError.ts)
- Why this is needed:
- Silent return can drop actionable errors when no auth handler is registered.
- Goal:
- Ensure auth errors are handled deterministically with fallback logging/handling.
- What to do:
- Enforce handler registration or fallback behavior.
- Possible traps and issues:
- Duplicate redirect flows if multiple auth handlers exist.
- Docs changes needed:
- Add auth error handling contract for utilities.
- Doc references:
- [frontend/src/providers/AuthProvider.tsx](frontend/src/providers/AuthProvider.tsx)
---
## 22) Magic strings are scattered in frontend storage keys
- Where found:
- [frontend/src/providers/AuthProvider.tsx](frontend/src/providers/AuthProvider.tsx)