Skip to content

Custom property on JWT is of type unknown #12674

Answered by ntdoJanneck
ntdoJanneck asked this question in Help
Discussion options

You must be logged in to vote

Okay so I just solved it myself. I added this import at the top of my next-auth.d.ts:

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 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:

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ntdoJanneck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant