Refactor authentication logic and API client
- Update AuthProvider with improved error handling and token management - Enhance API client with better request/response handling - Add comprehensive test coverage for auth flows - Update documentation with current tasks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -1,26 +1,3 @@
|
||||
### T-14 · Move jail detail sub-sections from `pages/jail/` to `components/jail/`
|
||||
|
||||
**Where found:** `frontend/src/pages/jail/` — `JailInfoSection`, `PatternsSection`, `BantimeEscalationSection`, `IgnoreListSection`, `jailDetailPageStyles.ts`. `BannedIpsSection` is in `frontend/src/components/jail/` (correct location).
|
||||
|
||||
**Why this is needed:** The project convention is `pages/` for route-level components and `components/` for reusable UI. Sub-sections are reusable UI building blocks, not route components. `BannedIpsSection` already lives in the right place. The inconsistency makes the directory structure misleading.
|
||||
|
||||
**Goal:** All `*Section` components for jail detail under `components/jail/`. `pages/jail/` deleted or contains only route-level entry points.
|
||||
|
||||
**What to do:**
|
||||
1. Move `JailInfoSection`, `PatternsSection`, `BantimeEscalationSection`, `IgnoreListSection`, and `jailDetailPageStyles.ts` to `frontend/src/components/jail/`.
|
||||
2. Update imports in `JailDetailPage.tsx`.
|
||||
3. Remove empty `pages/jail/` directory.
|
||||
|
||||
**Possible traps and issues:**
|
||||
- Confirm no other page imports from `pages/jail/` before deleting it.
|
||||
- Update any path-based test imports.
|
||||
|
||||
**Docs changes needed:** `Docs/Web-Development.md` — document the `pages/` vs `components/` convention explicitly.
|
||||
|
||||
**Doc references:** `Docs/Web-Development.md`
|
||||
|
||||
---
|
||||
|
||||
### T-15 · Replace `window` event bus for session expiry with React context callback
|
||||
|
||||
**Where found:** `frontend/src/api/client.ts` — `window.dispatchEvent(new Event(SESSION_EXPIRED_EVENT))`; `frontend/src/providers/AuthProvider.tsx` — `window.addEventListener(SESSION_EXPIRED_EVENT, ...)`
|
||||
|
||||
Reference in New Issue
Block a user