cameras/src/app
Michael Mainguy 5d181f3b3b Enforce admin login: login, first-run setup, proxy and access checks
Completes securing the web front end (vrek gol-wqf95dq, iss-r5vrjx7).

- /login: Server Action with a generic error, same-site-only redirect
  back to ?next=, and throttling of failed logins (10 per address and
  100 overall per 15 min). The header shows "Signed in as" with
  Sign out (iss-nj9wmwp).
- First run with no admin: instrumentation prints a one-time setup
  code, shared with the app through globalThis. /setup requires it,
  and 5 wrong codes rotate it. "Skip for now" runs unsecured for the
  browser session behind a red warning banner on every page
  (iss-9nxdndr).
- src/proxy.ts: optimistic redirects to /login or /setup, 401 for
  the API, and the 12 h sliding session refresh. requirePageAccess()
  and apiAccessDenied() re-check in the page and all 6 route handlers
  (iss-76d5wrb).
- An expired session now shows "Your session has ended" instead of
  the camera-login form.
- README documents in-app setup, skipping and signing in.

Verified with unit tests (383, 99.9% line coverage), end to end
against `next start`, and manually in a browser by the user.
Refreshes the vrek export.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-19 11:58:20 -05:00
..
api Enforce admin login: login, first-run setup, proxy and access checks 2026-09-19 11:58:20 -05:00
login Enforce admin login: login, first-run setup, proxy and access checks 2026-09-19 11:58:20 -05:00
setup Enforce admin login: login, first-run setup, proxy and access checks 2026-09-19 11:58:20 -05:00
auth-actions.test.ts Enforce admin login: login, first-run setup, proxy and access checks 2026-09-19 11:58:20 -05:00
auth-actions.ts Enforce admin login: login, first-run setup, proxy and access checks 2026-09-19 11:58:20 -05:00
auth-forms.test.tsx Enforce admin login: login, first-run setup, proxy and access checks 2026-09-19 11:58:20 -05:00
auth-pages.test.tsx Enforce admin login: login, first-run setup, proxy and access checks 2026-09-19 11:58:20 -05:00
camera-card.test.tsx Enforce admin login: login, first-run setup, proxy and access checks 2026-09-19 11:58:20 -05:00
camera-card.tsx Enforce admin login: login, first-run setup, proxy and access checks 2026-09-19 11:58:20 -05:00
camera-queries.ts Enforce admin login: login, first-run setup, proxy and access checks 2026-09-19 11:58:20 -05:00
camera-scanner.test.tsx Move dashboard client onto React Query hooks 2026-09-19 09:01:34 -05:00
camera-scanner.tsx Move dashboard client onto React Query hooks 2026-09-19 09:01:34 -05:00
favicon.ico Initial commit from Create Next App 2026-09-19 07:15:19 -05:00
globals.css Initial commit from Create Next App 2026-09-19 07:15:19 -05:00
layout.test.tsx Enforce admin login: login, first-run setup, proxy and access checks 2026-09-19 11:58:20 -05:00
layout.tsx Enforce admin login: login, first-run setup, proxy and access checks 2026-09-19 11:58:20 -05:00
page.tsx Enforce admin login: login, first-run setup, proxy and access checks 2026-09-19 11:58:20 -05:00
providers.test.tsx Reach 99.8% test coverage and enforce a 95% floor 2026-09-19 09:17:55 -05:00
providers.tsx Add ONVIF camera app with a server-rendered camera dashboard 2026-09-19 08:40:32 -05:00
refresh-rate-select.test.tsx Move dashboard client onto React Query hooks 2026-09-19 09:01:34 -05:00
refresh-rate-select.tsx Add ONVIF camera app with a server-rendered camera dashboard 2026-09-19 08:40:32 -05:00
refresh-rate.test.ts Add Vitest test suite with coverage reporting 2026-09-19 08:49:50 -05:00
refresh-rate.ts Add ONVIF camera app with a server-rendered camera dashboard 2026-09-19 08:40:32 -05:00
security-bar.test.tsx Enforce admin login: login, first-run setup, proxy and access checks 2026-09-19 11:58:20 -05:00
security-bar.tsx Enforce admin login: login, first-run setup, proxy and access checks 2026-09-19 11:58:20 -05:00