This repository has been archived on 2026-06-09. You can view files and clone it, but cannot push or open issues or pull requests.
wedding-app/apps/api/src
Claude 9294b152b8
feat: replace Cloudflare Access with email+password admin login
Cloudflare Access self-hosted apps require a Cloudflare-managed
zone, which workers.dev is not, so the JWT path never worked. Swap
in a small login flow that fits the two-person scope:

- POST /api/admin/login validates email against ALLOWED_ADMIN_EMAILS
  and password against ADMIN_PASSWORD (constant-time compare), then
  issues an HS256-signed JWT in an httpOnly cookie.
- POST /api/admin/logout clears the cookie.
- requireAdmin verifies the cookie via hono/jwt and exposes the
  email through context.
- New /admin/login page; the dashboard redirects there on 401 and
  uses /api/admin/logout for the Sair button.

Two new env vars are required (set as secrets in the dashboard):
ADMIN_PASSWORD and SESSION_SECRET. CF_ACCESS_* are no longer used.

https://claude.ai/code/session_01TPBqgcSJMppgrpiq7fLywL
2026-05-04 20:31:09 +00:00
..
db chore: scaffold Cloudflare Pages monorepo for wedding photos app 2026-05-01 23:30:50 +00:00
lib feat: replace Cloudflare Access with email+password admin login 2026-05-04 20:31:09 +00:00
routes feat: replace Cloudflare Access with email+password admin login 2026-05-04 20:31:09 +00:00
app.ts chore: scaffold Cloudflare Pages monorepo for wedding photos app 2026-05-01 23:30:50 +00:00
env.ts feat: replace Cloudflare Access with email+password admin login 2026-05-04 20:31:09 +00:00