Skip to content

feat: domain-based login restriction and workspace auto-assignment#24

Open
genisd wants to merge 1 commit intogynzyfrom
feat/restrict-logins-to-domains-and-auto-assign-workspace-to-domain
Open

feat: domain-based login restriction and workspace auto-assignment#24
genisd wants to merge 1 commit intogynzyfrom
feat/restrict-logins-to-domains-and-auto-assign-workspace-to-domain

Conversation

@genisd
Copy link
Copy Markdown
Member

@genisd genisd commented Apr 20, 2026

Summary

  • Add global login domain restriction via ALLOWED_LOGIN_DOMAINS env var
  • Add workspace auto-assignment based on email domain

Configuration

Login Restriction

Set ALLOWED_LOGIN_DOMAINS=gynzy.com,gynzy.nl to restrict OAuth logins to those domains only.

Workspace Auto-Assignment

Configure a workspace to auto-assign users by domain:

UPDATE workspaces 
SET allowed_domains = '["gynzy.com"]', auto_assign_enabled = true 
WHERE slug = 'gynzy';

Test plan

  • Test login with allowed domain succeeds
  • Test login with disallowed domain shows "domain not allowed" error
  • Test new user with matching domain auto-joins configured workspace
  • Test new user without matching domain gets personal workspace (fallback)

@genisd genisd changed the base branch from gynzy to main April 20, 2026 13:47
@genisd genisd changed the base branch from main to gynzy April 20, 2026 13:47
Adds two features for company SSO deployments:

1. Global login domain restriction via ALLOWED_LOGIN_DOMAINS env var
   - Rejects OAuth logins from domains not in the allowlist
   - Check happens in OAuth callback before user is created

2. Workspace auto-assignment based on email domain
   - Workspaces can configure allowedDomains and autoAssignEnabled
   - New users with matching email domain auto-join the workspace
   - Falls back to creating personal workspace if no match
@genisd genisd force-pushed the feat/restrict-logins-to-domains-and-auto-assign-workspace-to-domain branch from 712ba72 to 7d789d2 Compare April 20, 2026 13:48
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