next-auth icon indicating copy to clipboard operation
next-auth copied to clipboard

Typescript Module Augmentation example in documentation is wrong?

Open Huijiro opened this issue 2 years ago • 3 comments

What is the improvement or update you wish to see?

There's a example on the website to get typescript to behave properly with the custom User etc, but i think it is wrong because the example did not work for me, but i don't know if it is a svelte issue, or another thing.

Is there any context that might help us understand?

Augmenting the "@auth/core" module does nothing to the interfaces, you need to actually augment the "@auth/core/types" to make it work properly.

With augmentation to the "@auth/core" it does not know that the user has the property of role. image

But with augmentation of the "@auth/core/types" it works image

Does the docs page already exist? Please link to it.

https://authjs.dev/getting-started/typescript

Huijiro avatar Dec 12 '23 23:12 Huijiro

looks like the same with this issue #9253

cexra avatar Dec 14 '23 23:12 cexra

looks like the same with this issue #9253

So this is not a svelte specific issue? Just that the docs need to be updated then?

Huijiro avatar Dec 15 '23 19:12 Huijiro

Closing, this has been fixed. Thanks for the PR @Huijiro

ndom91 avatar Dec 29 '23 10:12 ndom91