TypeScript questions regarding type augmentation in NX project and problems with added session properties #6915
Unanswered
ColonelCordier
asked this question in
Help
Replies: 2 comments 1 reply
-
It doesn't matter where you augment a module, as long as the file is included in Hard to tell more as there was no reproduction given. |
Beta Was this translation helpful? Give feedback.
0 replies
-
i have the same problem, added types/next-auth.d.ts, and it just doesn't pick up, keep complaining about the session.user doesn't have the attribute I specified. seems like if I put the type augmentation directly next to the auth options variable file it worked. looks like .d.ts just never get picked up when it clearly stated with wildcard in include that it should pick up. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question 💬
Hi,
We've a large project using NX, NextJS, Next-Auth and Auth0 as a provider.
I updated yesterday NextAuth (@latest) since the
unstable_getServerSideProps
has been stabilized. Since then, the project doesn't build because of TS errors in the callbacks functions when I set some properties in the session object.Also, we were using the
email_verified
property from Auth0 (inprofile
object) to set an unverifiedRole
in our app. This is not working with the update anymore (but the property from Auth0 still exists since I can log theprofile
object when I sign in).Another question is about module augmentation, reading here https://next-auth.js.org/getting-started/typescript#module-augmentation, but I can't make it work in our NX project, that is architectured like this :
Where should I put the
types/next-auth.d.ts
file ?Thank you
How to reproduce ☕️
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
Beta Was this translation helpful? Give feedback.
All reactions