hendry.lim
hendry.lim
KKinde
Created by hendry.lim on 1/7/2025 in #💻┃support
getUser returns null when Using Kinde and Vercel Multitenancy
Hi, i am using Vercel's multitenancy architecture. I am able to successfully protect my pages at root (eg app.localhost:3000, app.localhost:3000/account etc). however, when i navigate to my subdomains (eg. demo.localhost:3000, xyz.localhost:3000/account), kinde's getUser from getKindeServerSession returns user null even though the user is logged in which i verified when I go to app.localhost:3000. anyone can point me to where i did wrong and how can i resolve this? thanks
const DomainPage = async ({ params }: Props) => {
const { domain, slug } = await params;
const decodedDomain = decodeURIComponent(domain); // xyz.localhost:3000
const decodedSlug = decodeURIComponent(slug); // account

const { getOrganization, getPermissions, getUser } = getKindeServerSession();
const user = await getUser(); // null when at xyz.localhost:3000/account
const organization = await getOrganization(); // null
const permissions = await getPermissions(); // null

return ( ... )
}
const DomainPage = async ({ params }: Props) => {
const { domain, slug } = await params;
const decodedDomain = decodeURIComponent(domain); // xyz.localhost:3000
const decodedSlug = decodeURIComponent(slug); // account

const { getOrganization, getPermissions, getUser } = getKindeServerSession();
const user = await getUser(); // null when at xyz.localhost:3000/account
const organization = await getOrganization(); // null
const permissions = await getPermissions(); // null

return ( ... )
}
3 replies
KKinde
Created by hendry.lim on 1/1/2025 in #💻┃support
Is it possible to get org code from the response after adding a organization via management api
I am able to successfully add organization via kinde's management api. However, i need to get the org_code to insert into my database via prisma. I looked at the response from calling the https://apps.kinde.com/api/v1/organization api and it just return the status, statusText, body etc but there is no mention of the org_code created. Can someone advise me on this? Thanks
8 replies