我正在学习abt护照和jwt身份验证,但我遇到一个错误,说Error: Unknown authentication strategy "jwt"
这是我的auth.js
const passport = require('passport')
module.exports = function(req, res, next){
passport.authenticate('jwt', function (err, user){
if (err || !user){
res.status(403).send({
error: "you dont have access to this resource"
})
}else{
req.user = user
next()
}
})(req, res, next)
}
谁能发现哪个错误?谢谢