auth: password admin + per-instance Google for listeners (no broker)
Robin's choice: every self-hoster has their own password admin account,
and can optionally let listeners log in to comment using their OWN Google
client. No central broker (that would tie every customer site to Robin's
Google Cloud -> systemic risk on abuse).
- Admin = username/password (bcrypt). First-time setup via /auth/register
(only when there are 0 users); closed afterwards. No public registration.
- Forgot password: /auth/reset-request -> email (if SMTP configured) with
reset link; CLI break-glass
npm run reset-admin always works (no email
needed).
- Change password (logged in) restored in /account.
- Google = per-instance own credentials, OPTIONAL, listeners only -> always
role member, never admin (god/admin email is rejected; google_sub mismatch
too).
- config/google.js back to direct Google OAuth; config/mailer.js new
(nodemailer).
- jose removed from deps; nodemailer added.
Security review (workflow) incorporated:
- Reset token no longer in production logs (dev only).
- Reset link from PUBLIC_BASE_URL instead of X-Forwarded-Host (host poisoning).
- Reset tokens stored SHA-256-hashed in the DB.
- Same-origin check on all state-modifying POSTs (CSRF layer on top of
sameSite-lax).
- Login always runs one bcrypt comparison (no timing enumeration).
Co-Authored-By: Claude <noreply@…>