Issue appears while I'm trying to access my API as unauthorized user.
For now my code looks like:
apiRoutes.get('/userinfo', passport.authenticate('jwt', { session: false}), function(req, res) {
var token = getToken(req.headers);
if (token) {
//...doing my staff
} else {
return res.status(403).send({error: true, msg: 'Unauthorized user'});
}
});
I've got this error:
TypeError: parsed_url.query.hasOwnProperty is not a function at JwtStrategy.authenticate (...\node_modules\passport-jwt\lib\strategy.js:108:89)
I've fixed that adding one more check to the IF statement:
Issue appears while I'm trying to access my API as unauthorized user. For now my code looks like:
I've got this error:
TypeError: parsed_url.query.hasOwnProperty is not a function at JwtStrategy.authenticate (...\node_modules\passport-jwt\lib\strategy.js:108:89)
I've fixed that adding one more check to the IF statement:
I don't know if it's correct? Or I'm doing something wrong.
...sorry, I'm using version 1.2.1. So, maybe this issue is closed now...