[PR #1927] [CLOSED] feat: Add organisation domain auto-assignment feature #1938

Closed
opened 2026-02-26 20:31:44 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1927
Author: @zimmra
Created: 7/25/2025
Status: Closed

Base: mainHead: feat/org-domain-autoadd


📝 Commits (2)

  • 2532a0a Add organisation domain auto-assignment feature
  • d74bb10 Add organisation domain auto-assignment docs and tests

📊 Changes

29 files changed (+3999 additions, -2 deletions)

View changed files

📝 apps/documentation/pages/developers/public-api/reference.mdx (+104 -0)
📝 apps/documentation/pages/users/get-started/account-creation.mdx (+15 -0)
📝 apps/documentation/pages/users/organisations/index.mdx (+32 -0)
📝 apps/documentation/pages/users/organisations/members.mdx (+45 -2)
📝 apps/remix/app/components/forms/branding-preferences-form.tsx (+24 -0)
apps/remix/app/components/forms/domain-access-settings-form.tsx (+299 -0)
📝 apps/remix/app/routes/_authenticated+/o.$orgUrl.settings.preferences.tsx (+3 -0)
packages/app-tests/e2e/organisations/domain-auto-assignment.spec.ts (+421 -0)
packages/app-tests/e2e/organisations/domain-management.spec.ts (+220 -0)
packages/app-tests/e2e/organisations/domain-ui-integration.spec.ts (+364 -0)
📝 packages/auth/server/lib/session/session.ts (+18 -0)
📝 packages/auth/server/lib/utils/handle-oauth-callback-url.ts (+28 -0)
packages/lib/server-only/organisation/domain-organisation.ts (+529 -0)
packages/lib/server-only/organisation/domain-security.ts (+76 -0)
packages/lib/server-only/organisation/login-domain-assignment.ts (+193 -0)
📝 packages/lib/server-only/user/verify-email.ts (+14 -0)
packages/lib/utils/domain.ts (+91 -0)
packages/prisma/add_domain_audit_logging.sql (+1101 -0)
packages/prisma/migrations/20250724093654_add_domain_performance_indexes/migration.sql (+31 -0)
📝 packages/prisma/schema.prisma (+21 -0)

...and 9 more files

📄 Description

Description

I didn't want to manually add our users to the organisation - this feature allows for defining email domains for an organisation that acts as a whitelist to auto-add any current or future user with the defined domain(s).

Changes Made

  • Implements domain-based automatic user assignment to organisations upon email verification and login.
  • Adds UI for managing organisation domains, server logic for assignment, domain validation utilities, and related database schema changes.
  • Also includes tRPC endpoints for domain management and audit logging for domain actions.

Testing Performed

Works great in our environment, but no testing outside of that

  • Built Docker Container Successfully
  • Performed Upgrade on Replication of Live Environment
  • Existing Users Were Added to the Defined Domains
  • New Users Were Added to the Defined Domains

Checklist

  • I have tested these changes locally and they work as expected.
  • I have added/updated tests that prove the effectiveness of these changes.
  • I have updated the documentation to reflect these changes, if applicable.
  • I have followed the project's coding style guidelines.
  • I have addressed the code review feedback from the previous submission, if applicable.

Additional Notes

Implements domain-based automatic user assignment to organisations upon email verification and login. Adds UI for managing organisation domains, server logic for assignment, domain validation utilities, and related database schema changes. Also includes tRPC endpoints for domain management and audit logging for domain actions.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/1927 **Author:** [@zimmra](https://github.com/zimmra) **Created:** 7/25/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/org-domain-autoadd` --- ### 📝 Commits (2) - [`2532a0a`](https://github.com/documenso/documenso/commit/2532a0af8f8cbb420321844e293997c4df58264c) Add organisation domain auto-assignment feature - [`d74bb10`](https://github.com/documenso/documenso/commit/d74bb10bd8710b4a0e59cadf56dcbf2dc862c29f) Add organisation domain auto-assignment docs and tests ### 📊 Changes **29 files changed** (+3999 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `apps/documentation/pages/developers/public-api/reference.mdx` (+104 -0) 📝 `apps/documentation/pages/users/get-started/account-creation.mdx` (+15 -0) 📝 `apps/documentation/pages/users/organisations/index.mdx` (+32 -0) 📝 `apps/documentation/pages/users/organisations/members.mdx` (+45 -2) 📝 `apps/remix/app/components/forms/branding-preferences-form.tsx` (+24 -0) ➕ `apps/remix/app/components/forms/domain-access-settings-form.tsx` (+299 -0) 📝 `apps/remix/app/routes/_authenticated+/o.$orgUrl.settings.preferences.tsx` (+3 -0) ➕ `packages/app-tests/e2e/organisations/domain-auto-assignment.spec.ts` (+421 -0) ➕ `packages/app-tests/e2e/organisations/domain-management.spec.ts` (+220 -0) ➕ `packages/app-tests/e2e/organisations/domain-ui-integration.spec.ts` (+364 -0) 📝 `packages/auth/server/lib/session/session.ts` (+18 -0) 📝 `packages/auth/server/lib/utils/handle-oauth-callback-url.ts` (+28 -0) ➕ `packages/lib/server-only/organisation/domain-organisation.ts` (+529 -0) ➕ `packages/lib/server-only/organisation/domain-security.ts` (+76 -0) ➕ `packages/lib/server-only/organisation/login-domain-assignment.ts` (+193 -0) 📝 `packages/lib/server-only/user/verify-email.ts` (+14 -0) ➕ `packages/lib/utils/domain.ts` (+91 -0) ➕ `packages/prisma/add_domain_audit_logging.sql` (+1101 -0) ➕ `packages/prisma/migrations/20250724093654_add_domain_performance_indexes/migration.sql` (+31 -0) 📝 `packages/prisma/schema.prisma` (+21 -0) _...and 9 more files_ </details> ### 📄 Description ## Description I didn't want to manually add our users to the organisation - this feature allows for defining email domains for an organisation that acts as a whitelist to auto-add any current or future user with the defined domain(s). ## Changes Made - Implements domain-based automatic user assignment to organisations upon email verification and login. - Adds UI for managing organisation domains, server logic for assignment, domain validation utilities, and related database schema changes. - Also includes tRPC endpoints for domain management and audit logging for domain actions. ## Testing Performed Works great in our environment, but no testing outside of that - Built Docker Container Successfully - Performed Upgrade on Replication of Live Environment - Existing Users Were Added to the Defined Domains - New Users Were Added to the Defined Domains ## Checklist - [x] I have tested these changes locally and they work as expected. - [x] I have added/updated tests that prove the effectiveness of these changes. - [x] I have updated the documentation to reflect these changes, if applicable. - [x] I have followed the project's coding style guidelines. - [ ] I have addressed the code review feedback from the previous submission, if applicable. ## Additional Notes <!--- Provide any additional context or notes for the reviewers. --> <!--- This might include details about design decisions, potential concerns, or anything else relevant. --> Implements domain-based automatic user assignment to organisations upon email verification and login. Adds UI for managing organisation domains, server logic for assignment, domain validation utilities, and related database schema changes. Also includes tRPC endpoints for domain management and audit logging for domain actions. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 20:31:44 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1938
No description provided.