trying to add role based authentication
I added a role parameter to my User schema, but it's still not catching it. Any one know why this may be?

35 Replies

TypeScript | NextAuth.js
NextAuth.js has its own type definitions to use in your TypeScript projects safely. Even if you don't use TypeScript, IDEs like VSCode will pick this up to provide you with a better developer experience. While you are typing, you will get suggestions about what certain objects/functions look like, and sometimes links to documentation, examples, ...

I changed thta
but still get these errors

reload ts server

I did 😭
lemme restart my ide
yea the issue still stands
what if you console log session and see what it includes for you
sure

it's printing out role
but giving it null
do you have a role?

yikes does this not work lol
you did db push?
yea I did

just did it again
lemme try again lol
yea it's still being funny
I don't think I can do the default thing like that
give me a minute ima try doing role stuff myself
I think I found the issue
trying my solution rn
nvm didin't work smh


works for me lol

ah I didn't do this part
that worked thanks 🙂
any chance you know why this error occurs?>


when I use an enum for the default value of role
🤷
all good, thanks 🙏
have a good time making what you making
appreciate it 🙏