next-auth session callback not recognizing new user property
I updated the User schema in schema.prisma like this:
and next-auth.d.ts
then inside [...nextauth].ts I have this:
The user.id works fine and it isn't complaining. but user.stripeCustomerId is...
I have tried:
1. Restarting TS server.
2. npx prisma generate
3. Restart VS code
Please let me know if you have stumbled upon this / know what the problem is. I am able to console.log(user.stripeCustomerId) so I know it is working.
3 Replies
I added this to my next-auth.d.ts as temporary solution, but is this correct?
I am not sure if it's because you made it optional in the prisma model but not on the type like | null or some other thing but that's how I done the thing at the time, I am open for improvement suggestions
most times all you need is to just restart your vscode