Multi-Tenant Setup: Cannot Create Users With Same Email in Different Tenants #13525
helloukey
started this conversation in
Feature Requests & Ideas
Replies: 1 comment 1 reply
-
Good point! I wonder if using email subaddressing (or plus addressing) - e.g |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using Payload CMS with a multi-tenant architecture. All tenants share the same MongoDB database. I’ve set up a
tenants
collection and a globalusers
collection that has a relationship/array field referencing one or more tenants.The problem is that I cannot create accounts with the same email address under different tenants. Payload enforces a globally unique index on the
email
field in the Users collection. This makes sense for single-tenant projects, but in a multi-tenant scenario it prevents the same person from registering separately under two different organizations.Current Behavior
Expected Behavior
In a multi-tenant setup, I would like Payload to support per-tenant email uniqueness:
Example Scenario
Beta Was this translation helpful? Give feedback.
All reactions