Skip to content

feat(auth): restrict Google login to an email allowlist - #51

Merged
overthelex merged 1 commit into
mainfrom
feat/google-login-allowlist
Jul 4, 2026
Merged

feat(auth): restrict Google login to an email allowlist#51
overthelex merged 1 commit into
mainfrom
feat/google-login-allowlist

Conversation

@overthelex

Copy link
Copy Markdown
Owner

What

Google OAuth callback now enforces an email allowlist via GOOGLE_ALLOWED_EMAILS (comma-separated). Emails not on the list are redirected to /login?error=not_authorized before any user is auto-created.

  • Empty GOOGLE_ALLOWED_EMAILS = allow any (unchanged default behavior).
  • Prod .env.prod already set to: mcvovkes@gmail.com,teosoph@gmail.com,shepherdvovkes@gmail.com.

Why

Previously the callback auto-provisioned a user for any Google account. This limits sign-in on crm.legal.org.ua to the intended operators.

Notes

  • Only affects the Google OAuth path (password login and already-issued JWT cookies are unchanged).
  • Prod was already updated manually (env + rebuilt image); this PR persists the code so a future CI rsync --delete deploy doesn't revert enforcement.

🤖 Generated with Claude Code

Google OAuth callback now rejects any email not present in
GOOGLE_ALLOWED_EMAILS (comma-separated). Empty = allow any (unchanged
default). Prevents auto-provisioning accounts for arbitrary Google users.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@overthelex
overthelex merged commit 452c0bd into main Jul 4, 2026
2 checks passed
@overthelex
overthelex deleted the feat/google-login-allowlist branch July 4, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant