Next.js Discord

Discord Forum

Multi tenancy with nextauth.js

Unanswered
Ovenbird posted this in #help-forum
Open in Discord
OvenbirdOP
Heyo all, I want to create an application that allows users to spin up their own "dashboard" which has it's own users and config.

The user would go to my main website and create a "dashboard"

Then the user would either pick a subdomain, or have to enter their own custom domian.

Then they can access this dashboard which has it's own users, own administrators etc.

Would I be able to achieve this with next auth? If so, I'm just unsure where to start tbh and would appreciate some pointers

12 Replies

OvenbirdOP
Bump :)
OvenbirdOP
Sure, as far as I know, that is not applicable to me (I've looked and googled before)
There is only one "user base" there
The main website where the site admin logs into
The blog page does not contain authentication
Maybe I'm wrong and this is a different one
@Ovenbird Maybe I'm wrong and this is a different one
Toyger
it's only a foundation, pretty good actually, from there you can extend whatever functionality you need.
@Toyger it's only a foundation, pretty good actually, from there you can extend whatever functionality you need.
OvenbirdOP
So just to confirm, the sub pages / dashboards it makes also use authentication
@Ovenbird So just to confirm, the sub pages / dashboards it makes also use authentication
Toyger
from their demo probably not, but it's pretty logical, if you want such wide auth system, you need to provide different oauth keys for each new subdomain.
and even then it's still good foundation to start, you can implement your preffered flow on your own. As they show in demo description https://vercel.com/templates/next.js/platforms-starter-kit they have different customers that already did that, so at least it possible.
OvenbirdOP
Hm right I see
It would be good if there was a dedicated guide out there for it 🤣 But I appreciate the links and will take a look