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 ( ... )
}
2 Replies
CB_Kinde
CB_Kinde2w ago
Hi @hendry.lim this doc was very recently updated. Can you check this is how you have seet up with vercel?
CB_Kinde
CB_Kinde2w ago
Kinde docs
Deploy an app on Vercel
Our developer tools provide everything you need to get started with Kinde.

Did you find this page helpful?