Next.js Discord

Discord Forum

OAuth in multi tenant app

Unanswered
Exzotic posted this in #help-forum
Open in Discord
Hello! I am looking for suggestions to implement oauth sign in into my multi tenant app. So that for example tenant A on tenanta.com would have its own users / auth seperate from tenant B on tenantb.com and the managing dashboard.

I did manage to get something like this working but it seems pretty jank / unsecure where there's a central auth.example.com that you login with discord oauth which then redirects you with the code grant to tenanta.com/auth/redirect. The tenanta.com was stored in a cookie so it knew where to redirect but would redirect yo to the wrong site if you tried logging into both tenanta.com and tenantb.com at the same time.

1 Reply

^