K
Kinde13mo ago
Thomas

user.email not working

giving me this error: Property 'email' does not exist on type 'Promise<KindeUser | null>'.
5 Replies
onderay
onderay13mo ago
Thanks @Thomas getting the team to look into this for you
Thomas
ThomasOP13mo ago
Thanks
onderay
onderay13mo 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
ThomasOP13mo ago
It worked thank you very much!
onderay
onderay13mo ago
Yay! Thats awesome the hear!
Want results from more Discord servers?
Add your server