mikenicholson / passport-jwt

Passport authentication using JSON Web Tokens
MIT License
1.96k stars 213 forks source link

fromAuthHeader is not a function #126

Closed AnimeshKashyap closed 7 years ago

AnimeshKashyap commented 7 years ago

const JwtStrategy = require('passport-jwt').Strategy; const ExtractJwt = require('passport-jwt').ExtractJwt; module.exports = function(passport){ let opts = {}; opts.jwtFromRequest = ExtractJwt.fromAuthHeader(); ^

TypeError: ExtractJwt.fromAuthHeader is not a function

mikenicholson commented 7 years ago

This was done intentionally. V3.0.0 was released as a major version precisely because it is not API compatible. See https://github.com/themikenicholson/passport-jwt#migrating-from-2xx-to-3xx for reasoning and upgrade path.