You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: validate sign-in emails with BRAIN_ALLOWED_EMAILS_REGEX (#183)
Replaces `WORKSPACE_DOMAIN` (a single-domain suffix check) with
`BRAIN_ALLOWED_EMAILS_REGEX`, a regex matched case-insensitively against
the account email in the better-auth sign-in hook. This allows
wildcarding a whole workspace (`.*@onfabric\.io$`) or listing a fixed
set of emails even across domains
(`^(alice@gmail\.com|bob@outlook\.com)$`). When unset, any email may
sign in.
The old var was never wired into deployments (prod relied on the
backend's hardcoded `onfabric.io` default, now removed), so this also
plumbs the value through both deploy paths — the CI environment contract
and the interactive CLI deploy — into the on-box `.env`. The `dev` CI
environment is set to `.*@onfabric\.io$` to preserve the existing
restriction.
The AWS config field was renamed `workspaceDomain` → optional
`allowedEmailsRegex`; existing `.company-brain.aws.json` files still
parse (the old key is dropped), so a re-deploy from an old config falls
back to "allow any" on the interactive path until `deploy setup` is
re-run.
Validated with `bun check:all` and the full test suite.
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments