managarten/services/mana-auth/src
Till JS a7fe828d32 refactor(auth): extract sso-origins SSOT + harden drift test
TRUSTED_ORIGINS was defined inside better-auth.config.ts, which pulls
in the whole Better Auth stack just to read a list of hostnames. Anyone
who wants to consume the list (infra tooling, compose-env generators,
monitoring) had to either duplicate it or pay the import cost.

- New `sso-origins.ts` — zero-dep module exposing
  `PRODUCTION_TRUSTED_ORIGINS` + `LOCAL_TRUSTED_ORIGINS` + the combined
  `TRUSTED_ORIGINS` list. This is now the canonical place to add a new
  top-level SSO origin.
- `better-auth.config.ts` imports + re-exports so existing consumers
  keep working without a touch.
- `sso-config.spec.ts` imports directly from `./sso-origins` (cleaner
  coupling) and now HARD-FAILS when mana-auth CORS_ORIGINS contains a
  production origin that isn't in trustedOrigins. Previously this was
  a `console.warn` only, meaning dead-drift could silently accumulate
  and then surface as a confusing runtime auth rejection.
- Root CLAUDE.md "Adding an app to SSO" updated to point at the SSOT
  and mention the new hard-fail direction.

No current drift — the mana-auth CORS_ORIGINS already match. The
hardened assertion is defensive for future changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 19:45:42 +02:00
..
auth refactor(auth): extract sso-origins SSOT + harden drift test 2026-04-19 19:45:42 +02:00
db fix(mana-auth) + chore: rewrite /api/v1/auth/login JWT mint, remove Matrix stack 2026-04-08 16:32:13 +02:00
email feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
lib feat(services): create mana-auth (Hono + Bun) — Phase 5 auth rewrite 2026-03-28 02:43:44 +01:00
middleware refactor(shared-tailwind): rewrite themes.css to single-layer shadcn convention 2026-04-09 01:13:06 +02:00
routes docs: update architecture comparison — 5/10 roadmap items done 2026-04-16 15:00:09 +02:00
services feat(ai,auth): Mission Grant endpoint + unwrap helper + audit table 2026-04-15 13:41:59 +02:00
config.ts feat(ai,auth): Mission Grant endpoint + unwrap helper + audit table 2026-04-15 13:41:59 +02:00
index.ts feat(ai,auth): Mission Grant endpoint + unwrap helper + audit table 2026-04-15 13:41:59 +02:00