K
Kinde14mo ago
Thomas

user.email not working

giving me this error: Property 'email' does not exist on type 'Promise<KindeUser | null>'.
5 Replies
onderay
onderay14mo ago
Thanks @Thomas getting the team to look into this for you
Thomas
ThomasOP14mo ago
Thanks
onderay
onderay14mo ago
@Thomas are you able to update to use this? import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server"; export default async function Dashboard() { const { getUser } = getKindeServerSession(); const user = await getUser(); return ( <main> {user && ( <div> <div>{user?.email}</div> </div> )} </main> ); } The short answer is that your default function should be async and you have to await getUser()
Thomas
ThomasOP14mo ago
It worked thank you very much!
onderay
onderay14mo ago
Yay! Thats awesome the hear!
Want results from more Discord servers?
Add your server