jwt malformed message
joetidee opened this issue · 3 comments
joetidee commented
Expected behavior
I would expect the message in the http response to match that specified in the done
function.
Actual behavior
I receive the following http response:
{"statusCode":401,"error":"Unauthorized","message":"jwt malformed"}
return done(null, false, { message : 'foobar' });
Environment
- Operating System: Mac OsX
- Node version: 8.11.1
- passport version: 0.4.0
- passport-local version: 1.0.0
jaredhanson commented
This package does not process JWTs, so a message of "jwt malformed"
suggests that the error is occurring in application-level code, rather than this package. Could you provide any diagnostics that led you to pinpoint this package as the source of the issue?
joetidee commented
This is the full code that I'm running, which is a function that is provided by your package:
const PassportLocalStrategy = require('passport-local').Strategy;
module.exports = new PassportLocalStrategy({
usernameField: 'email',
passwordField: 'password',
session: false,
passReqToCallback: true,
}, async (req, email, password, done) => {
try {
return done(null, false, { message : 'foobar' });
} catch (err) {
}
});
joetidee commented
Ok, this error is thrown by jsonwebtoken
package