Multi level tenancy

I'm writing a multi level tenancy app (allowing agencies to have their own tenants, it's a multi level tenancy as each level is isolated). Currently, Better-Auth forbids the creation of users with the same email address, but if a single person is client of 2 different agencies, they should be able to create accounts with the same email. @Better Auth
2 Replies
Better Auth
Better Auth3w ago
At the moment, Better Auth enforces email uniqueness across the entire application. This means that if a user has already signed up with one agency, using the same email for another agency under the current configuration will trigger an error—exactly the issue you're encountering. There is an open feature request aimed at supporting multi-tenant setups where an email can be unique per tenant (for example, one agency versus another) by separating the unique constraint to a per-tenant basis [5]. Have you considered a possible work-around, such as extending your tenant scheme to include a tenant identifier in your custom sign-up logic? Or would you like to wait for native multi-tenant support? I'd be happy to discuss further options—what does your tenant isolation look like in your app? Sources: [5] Multi-Tenant userbases / updatable user schema — Better Auth is powered by https://clarm.com
GitHub
better-auth/better-auth
The most comprehensive authentication framework for TypeScript - better-auth/better-auth
GitHub
Multi-Tenant userbases / updatable user schema · Issue #1248 · be...
Is this suited for github? Yes, this is suited for github Is your feature request related to a problem? Please describe. Hi, I'm looking to create a B2B2C SaaS application with a couple require...
ben
ben2w ago
Are there other large-scale systems that work like this? e.g. AWS or Entra?

Did you find this page helpful?