mikenicholson / passport-jwt

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

Documentation outdated? #124

Closed jakelowen closed 7 years ago

jakelowen commented 7 years ago

README documentation gives example of opts.jwtFromRequest = ExtractJwt.fromAuthHeaderAsBearerToken();

It appears that fromAuthHeaderAsBearerToken() is no longer a valid method. Generates error:

TypeError: _passportJwt.ExtractJwt.fromAuthHeaderAsBearerToken is not a function

mikenicholson commented 7 years ago

I'm guessing you're looking at the documentation for the unreleased 3.0.0 version on GitHub. If you're getting the latest released version from NPM you should go by the README here: https://www.npmjs.com/package/passport-jwt.

Olu93 commented 7 years ago

I want to support this issue. README talks about "jsonWebTokenOptions" passing as object in thew configuration but there is no implementation for it in the code. Please update this documentation, too.

mikenicholson commented 7 years ago

@Olu93 as stated in my comment - The README on github by default shows the version of the file checked into the master branch. Master branch contains the latest developement version. You should be looking at the README on npmjs.org for the released version or, if you want to use Github, switch to the tag corresponding to the version that you are using.

mikenicholson commented 7 years ago

Closing. v3.0.0 was released and this wasn't really an issue to begin with.

If you're getting your pacakages form NPM and not github I recommend reading the README as hosted on NPM since it matches the latest published version.