Closed FBosler closed 4 years ago
when trying to use custom callback like so:
passport.authenticate("jwt", function (err, user, info) { console.log(chalk.red.bold("Called:"), chalk.bold.bgBlue.white('jwtAuthenticateCustomCallback')); console.log('err',err) console.log('user',user) console.log('info',info) if (err) { console.log(chalk.red(err)); return res.status(400).json({ errors: err }); } if (!user) { console.log(chalk.red(err)); return res.status(400).json({ errors: "No user found" }); } })(req, res, next);
I am getting the "No auth token" or "invalid signature" in the info argument and not the expected error argument.
See discussion in #160. This is correct behavior, though we should be passing strings and not Error objects to strategy.fail().
when trying to use custom callback like so:
I am getting the "No auth token" or "invalid signature" in the info argument and not the expected error argument.