Open Jay-Karia opened 2 weeks ago
To remove these errors and enable autocompletion for the properties, you need to extend the JWT
type in your project. For more information on how to do this, read more here. The default values for these types are:
interface JWT {
name?: string | null
email?: string | null
picture?: string | null
sub?: string
iat?: number
exp?: number
jti?: string
}
For this reason, the id
property is unknown and shows as not assignable to type string
.
IMO, this should be mentioned in the docs
What is the improvement or update you wish to see?
The code examples listed here: https://authjs.dev/guides/extending-the-session#with-jwt as a Typescript error.
Is there any context that might help us understand?
The code should be updated to:
Does the docs page already exist? Please link to it.
https://authjs.dev/guides/extending-the-session#with-jwt