How to update jwt session
Unanswered
shaurya#007 posted this in #help-forum
If i update a user role in my database, how to I update that users session since it is in jwt
8 Replies
do you mean you use jwt strategy instead of database?
easy way is just set strategy to database, so session id is stored in cookie instead.
@tafutada777 easy way is just set strategy to database, so session id is stored in cookie instead.
Thank you, I am also using mongoose for for mongo db connection and creating modals. Is it optimal or I should use any other package for data base .and why does next js creates a new connection for every request ?
I am new to next js
@tafutada777 do you mean you use jwt strategy instead of database?
I am using credentials provider
@shaurya#007 Thank you, I am also using mongoose for for mongo db connection and creating modals. Is it optimal or I should use any other package for data base .and why does next js creates a new connection for every request ?
Vespid wasp
mongodb on ur api route is a server side module and transpiles every time its imported. I could be wrong but thats what i figured till now.
sorry im bit confused. i was talking about Auth.js as you mentioned JWT.
but now you talking about db connections.
but now you talking about db connections.
you might want to separate threads