Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'user' is possibly 'null'.ts(18047) const user: KindeUser | null #105

Open
iamLiwansh opened this issue May 26, 2024 · 2 comments
Open

'user' is possibly 'null'.ts(18047) const user: KindeUser | null #105

iamLiwansh opened this issue May 26, 2024 · 2 comments

Comments

@iamLiwansh
Copy link

import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server"

const Page = async () => {
const {getUser} = getKindeServerSession()
const user = await getUser()

return <div>{user.email}</div>

}

export default Page

@Manancode
Copy link

use user?.email

@coreymunn3
Copy link

You may have some issue with TRPC setup. You should not have to use ?. operator anywhere with the Kinde user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants