K
Kinde17h ago
Pinx0

Multi-tenant app served from many subdomains

I have a single instance of the app but it's served from different subdomains. I then use x-forwarded-host to determine the relevant tenant. I use Next.js app router SDK, latest version. When configuring KINDE_SITE_URL I'm not sure what to pass because it depends on runtime. I tried https://{organization.handle}.my-domain.com but it doesn't work because the user is eventually redirected there. Tried relative paths but doesn't work either. After login, I'm redirected to KINDE_SITE_URL/api/callback with the code and so on, but when that domain isn't the originating one, then the state is missing (beside a myriad other problems with that) Not sure how to proceed other than forking the SDK and editing the conflictive parts myself, but I'd like to avoid that... there must be a way to do this right?
1 Reply
Pinx0
Pinx0OP13h ago
potential workaround

Did you find this page helpful?