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

getUser() type does not include the possibility to be null #263

Open
4 tasks done
jonathanatger opened this issue Jan 27, 2025 · 0 comments
Open
4 tasks done

getUser() type does not include the possibility to be null #263

jonathanatger opened this issue Jan 27, 2025 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@jonathanatger
Copy link

Prerequisites

Describe the issue

When using getKindeServerSession() and the function getUser(), the return type inferred is :

Promise<KindeUser<Record<string, any>>>

The resulting object can however be null, but it isn't picked up upon by TS. It notably can make the build of a nextjs production build fail, as the User is not defined at that moment.

Library URL

https://github.com/kinde-oss/kinde-auth-nextjs

Library version

2.4.6

Operating system(s)

macOS

Operating system version(s)

macOS 15.2

Further environment details

No response

Reproducible test case URL

No response

Additional information

No response

@jonathanatger jonathanatger added the bug Something isn't working label Jan 27, 2025
@DanielRivers DanielRivers added this to the 2.6 milestone Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants