dragonflight/services/web-ui
Zac 0c3a4b625f feat(mam-api,web-ui): Google OAuth (OIDC) sign-in
Optional "Sign in with Google" with auto-provisioning, fully config-gated:
without GOOGLE_CLIENT_ID/SECRET and OAUTH_REDIRECT_URL the routes 404 and the
button is hidden, so deployments without SSO are unaffected.

- migration 028: users.google_sub (unique) + email; password_hash nullable
  for OAuth-only accounts
- src/auth/google-oauth.js: lazy google-auth-library, ID-token verify,
  GOOGLE_ALLOWED_DOMAIN enforcement, requires email_verified === true
- auth routes: /auth/google (state-CSRF redirect), /auth/google/callback,
  /auth/google/enabled; reuses establishSession
- web-ui: "Sign in with Google" on the login screen (shown only when enabled),
  friendly callback error handling
- .env.example documents all new vars

Security hardening (from review of this + the TOTP work):
- resolveGoogleUser links ONLY by google_sub, never by email — a Google login
  can never seize a pre-existing local account (account-takeover fix)
- a Google-linked account with TOTP still requires the second factor (ticket
  in session, /?mfa=1 step) instead of bypassing it
- /login/totp now applies the per-IP login backoff
- recovery-code consumption is atomic (WHERE used_at IS NULL + rowCount)
- concurrent first-login race on google_sub is caught and re-resolved
- tests: google-oauth config helpers + google-link takeover/dedup regression

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-30 02:51:59 +00:00
..
public feat(mam-api,web-ui): Google OAuth (OIDC) sign-in 2026-05-30 02:51:59 +00:00
scripts chore: 1.2 ship-prep sweep — close 38 issues 2026-05-27 02:06:14 +00:00
src/css rebrand: Dragonflight — ember orange accent (hue 266→32) 2026-05-21 22:16:32 -04:00
.dockerignore add services/web-ui/.dockerignore 2026-04-07 21:58:21 -04:00
.gitignore web-ui: fix corrupted .gitignore from earlier patch 2026-05-21 12:31:18 -04:00
Dockerfile chore: 1.2 ship-prep sweep — close 38 issues 2026-05-27 02:06:14 +00:00
nginx.conf fix(web-ui): forward X-Forwarded-Proto from outer proxy so mam-api emits Set-Cookie 2026-05-27 22:11:27 -04:00
package.json chore: 1.2 ship-prep sweep — close 38 issues 2026-05-27 02:06:14 +00:00
postcss.config.js web-ui: fix wave-1 build pipeline (primitives missing from bundle) 2026-05-21 16:41:55 +00:00
tailwind.config.js web-ui: fix wave-1 build pipeline (primitives missing from bundle) 2026-05-21 16:41:55 +00:00