Does anyone have an example of how B2B2C works with platform starter kit?
Unanswered
Iridescent shark posted this in #help-forum
Iridescent sharkOP
I am working with the platform starter kit to build a multi tenant application and having a hard time wrapping my head around how authentication is done using NextAuth at the subdomain level. What are sites like Super and Typedream doing to allow their users to create websites that those sites have auth on.
Ex: I visit Typedream, I create a website for my audience to access. If members of my audience wanted to create an account for my website, how does that auth differ from the auth used to log in to Typedream.
Anything to point me in the right direction would be much appreciated!
Ex: I visit Typedream, I create a website for my audience to access. If members of my audience wanted to create an account for my website, how does that auth differ from the auth used to log in to Typedream.
Anything to point me in the right direction would be much appreciated!
2 Replies
Orinoco Crocodile
I don't think this has anything to do with NextAuth per se, and more with how you plan to support multi-tenency at database/storage level. There are generally 3 approaches for databases:
1. Single database and shared schema (most common)
2. Single database and separate schema (better from all points of view, but scales worse)
3. One database per tenant (only if you expect a limited numbers of tenants)
Now, NextAuth can work with any of these, and your problem becomes just a matter of configutation: you have to tell NextAuth where to write the user, session etc.
1. Single database and shared schema (most common)
2. Single database and separate schema (better from all points of view, but scales worse)
3. One database per tenant (only if you expect a limited numbers of tenants)
Now, NextAuth can work with any of these, and your problem becomes just a matter of configutation: you have to tell NextAuth where to write the user, session etc.
Iridescent sharkOP
Gotcha, that's probably where my confusion lies. I am wanting to do Single database and shared schema. Was thinking having a the user's table with roles at first to distinguish but then wasn't sure if I could split it into two tables one for users of the parent site and one for users for the subdomain site. Haven't read anything to support this is any of the next auth docs. Do you have a reference to what you're mentioning regarding NextAuth?