As mentioned previously, passport.js provides a lot of strategies for easy integration. One of the strategies that we will be working on with is the JWT strategy. We have already added passport.js and initialized it. Now, let's add this strategy as well.
passport.js strategies
Installing the passport-jwt strategy
Just installing passport module is not sufficient for our needs. passport.js provides its strategies in separate npm packages. For jwt authentication, we have to install the passport-jwt module, as follows:
$ npm install passport-jwt --save
On successful installation, you should have these packages listed in the package.json file of the application:
...
"nodemon": "^1.14.10",
"passport...