Add OPTIONS to API proxy, fix admin event listener accumulation, rename admin routes from /a/ to /admin/

- Add OPTIONS to the web API proxy route methods for CORS preflight support
- Fix event listener accumulation in admin/node-tags.js and admin/members.js
  using AbortController with cleanup functions returned to the SPA router.
  lit-html reuses DOM elements across re-renders, causing addEventListener
  calls to accumulate and fire multiple times per form submission.
- Rename admin routes from /a/ prefix to /admin/ for clarity
- Add debug logging for admin route access and OIDC role checks
- Move auth section in navbar after theme toggle
- Update tests and AGENTS.md accordingly
This commit is contained in:
Louis King
2026-04-29 00:45:45 +01:00
parent d1b6f0d0a7
commit 2af8b281ea
12 changed files with 110 additions and 87 deletions
@@ -93,10 +93,10 @@ Role assignment flow:
```
Browser Web App (:8080) OIDC Provider (IdP)
| | |
| GET /a/node-tags | |
| GET /admin/node-tags | |
|------------------------------>| |
| | No session |
| 302 /auth/login?next=/a/node-tags |
| 302 /auth/login?next=/admin/node-tags |
|<------------------------------| |
| | |
| GET /auth/login | |
@@ -116,10 +116,10 @@ Browser Web App (:8080) OIDC Provider (IdP
| |<------------------------------|
| | Extract userinfo + roles |
| | Set session cookie |
| 302 → /a/node-tags | |
| 302 → /admin/node-tags | |
|<------------------------------| |
| | |
| GET /a/node-tags | |
| GET /admin/node-tags | |
|------------------------------>| |
| | Session valid, role=admin |
| | Proxy to API with api_key |