Open gkatsanos opened 4 years ago
I was wondering if the following is correct: router.get(validate.authorization, authorize(), controller.list);
router.get(validate.authorization, authorize(), controller.list);
const handleJWT = (req, res, next) => async (err, user, info) => { const error = err || info; if (err || !user) { Boom.boomify(error, { statusCode: 401, stack: err ? err.stack : 'null' }); return next(error); } req.user = user; return next(); }; exports.authorize = () => (req, res, next) => passport.authenticate("jwt", { session: false }, handleJWT(req, res, next))( req, res, next );
It seems the handleJWT is not getting all parameters under some scenarios and by reading at the documentation wasn't sure if what I'm doing is correct.
I was wondering if the following is correct:
router.get(validate.authorization, authorize(), controller.list);
It seems the handleJWT is not getting all parameters under some scenarios and by reading at the documentation wasn't sure if what I'm doing is correct.