Closed Funnybanny closed 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
?
i use 2.2.1 i will update it
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.
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.