DEV Community

Discussion on: Using Cookies with JWT in Node.js

 
franciscomendes10866 profile image
Francisco Mendes

Exactly. If you do it this way you end up with less boilerplate in your Api. The use of Passport.js is not incorrect, I just like to show that we can make simple and functional implementations. 🥸

Thread Thread
 
aziz477 profile image
aziz477

please can you tell me what is the exact role of passport strategy next to the normal jwt?

Thread Thread
 
franciscomendes10866 profile image
Francisco Mendes

Passport is a middleware with a good level of abstraction, for example, with jwt you wouldn't have to write that much code. In addition to being faster to implement, it is also the simplest. However, business rules can change from project to project so I advise people to know how to do a simple setup.