K
Kinde10mo ago
Thomas

user.email not working

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