mikenicholson / passport-jwt

Passport authentication using JSON Web Tokens
MIT License
1.97k stars 214 forks source link

ExtractJwt.fromAuthHeaderAsBearerToken() doesnt exist and ExtractJwt.fromAuthHeader() doesnt work #129

Closed Funnybanny closed 7 years ago

Funnybanny commented 7 years ago

ExtractJwt.fromAuthHeaderAsBearerToken() doesnt exist and ExtractJwt.fromAuthHeader() doesnt work, instead i used ExtractJwt.fromHeader("authorization") to get my token from the authorization header. Please remove it from documentation it took me some time to figure this out.

mikenicholson commented 7 years ago

I'm going to guess that you're looking at the 3.0 documentation while using a 2.0 version of the library. What version of the passport-jwt library are you depending on in your project's package.json?

Funnybanny commented 7 years ago

i use 2.2.1 i will update it

mikenicholson commented 7 years ago

That explains the discrepancy. Documentation posted online is for the latest version, which is 3.0.0. As it is a major rev it is not backwards compatible.

If you want to see the 2.2.1 docs you can view the README.md in the root of the repo by checking out the v2.2.1 tag or viewing it online in github, switching from master branch to the desired tag.