KindeK
Kinde2y ago
6 replies
NewbBtw

GetUser() returning Null on Live Nextjs.

Hi all i am hoping anyone could help me with this query.

I have a Nextjs14 application using Kinde Auth. It was working fine, but I woke up to a random bug on live. getUser is reutuning null only on live.

const { getUser } = getKindeServerSession() const user = await getUser() console.log("fetching user", user) const ADMIN_EMAIL = process.env.ADMIN_EMAIL; if (!user || user.email !== ADMIN_EMAIL) { return notFound(); }
inside by dashboard route i have this logic to get the currently logged in user, but i have come to notice that getUser is returning null and this only happens on live. Does anyone else have this issue and how did they go about fixin it?
Was this page helpful?