11/20/2022, 11:14 AM
Gday folks, trying to investigate a multitenant implementation with NextJS. The idea is to provide each customer a subdomain, eg; Which can later be changed to if the user would like. I'd like to support the concept that registered users may be a part of more than one subdomain. For example: and So if the user accesses, it allows them to login if they were added by an administrator to the backend. Similarly, if they tried to access, it'd allow them to login. However if they tried to login to, a website they're not a part of, it would not let them in. I took a look at the examples you have on Github but this part kind of ruled it out unless I am misunderstanding:
the subdomain for each user is extracted from their email provider, ex. for, abc would be the subdomain.
As in this case, they may be using, which would have access to and, instead of
Just realised I never really asked a question. How would you recommend implementing this solution? Have I missed the plot? Based on the current business case, it's highly likely the same user may be added to several subdomains.