You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Migrate off of the Payload multi-tenant plugin components/functions #552
@payloadcms/plugin-multi-tenant is currently a blocker to upgrading Payload which we want to do for #339 and just to stay up to date in general. See: #450 (comment)
It makes sense to move off the Payload multi-tenant plugin because there is a key difference in how we do multi-tenancy and how the plugin expects us to be doing multi-tenancy.
The plugin expects there to be a tenants array on a user. But we determine association between a user and a tenant via rules-based, tenant-scoped roles. So it seems likely that we'll run into more issues in the future and I don't think it makes sense to request the Payload team to support our use case since they've made a clear decision on how tenancy is expected to work with their plugin.
Right now, we're only using components and helper functions from their plugin anyways. We can easily copy and paste these into our own repo from a version that works for us and maintain our own divergent copies. We may want to make updates to these based on our approach (although they'll likely stay very similar at first).
The work here should actually be pretty minimal - mostly just making sure that we maintain functionality.
There might be a gotcha if there are many dependencies that we need to pull over from the plugin but I think we can manage.
Does this mean we could also go back to putting the tenant domain/slug into the cookie, instead of the db ID, and obviate that indirection?
Yea, actually, we could do that. That might be really nice to simplify that. We wouldn't need to fetch from the edge config to get tenant ids and could hardcode all avalanche center slugs in the middleware directly.
That's a hard refactor to justify though, tbh. I've created a issue for that: #579
We could discuss at our next check-in to see if we think it's worth doing.
Activity
stevekuznetsov commentedon Oct 2, 2025
Does this mean we could also go back to putting the tenant domain/slug into the cookie, instead of the db ID, and obviate that indirection?
busbyk commentedon Oct 5, 2025
Yea, actually, we could do that. That might be really nice to simplify that. We wouldn't need to fetch from the edge config to get tenant ids and could hardcode all avalanche center slugs in the middleware directly.
That's a hard refactor to justify though, tbh. I've created a issue for that: #579
We could discuss at our next check-in to see if we think it's worth doing.