Custom property on JWT is of type unknown #12674
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Okay so I just solved it myself. I added this import at the top of my import "next-auth/jwt"; I must have overlooked this part in the docs, since the import in the docs is in the middle of the file right before the One thing I noticed with the docs though, the import used there is a different from the one I use now: import { JWT } from "next-auth/jwt" When I add this import instead of my version, it gets recognized as an unused import and removed by eslint on save. Not sure if this is intended, but since it works for me now I'd consider this discussion resolved. |
Beta Was this translation helpful? Give feedback.
Okay so I just solved it myself. I added this import at the top of my
next-auth.d.ts
:I must have overlooked this part in the docs, since the import in the docs is in the middle of the file right before the
declare module "next-auth/jwt"
and I'm used to seeing all relevant imports at the top of the file.One thing I noticed with the docs though, the import used there is a different from the one I use now:
When I add this import instead of my version, it gets recognized as an unused import and removed by eslint on save. Not sure if this is intended, but since it works for me now I'd consider this discussion resolved.