ryanfitz/hapi-auth-jwt

validateFunc has an incorrect function signature

virtualdom opened this issue · 4 comments

The docs state that validateFunc is a function with the following signature
function (request, decodedToken, callback)
As of now, the signature is actually
function(decodedToken, callback)

Consider making changes in either the documentation to reflect this or making changes in validateFunc code.

@virtualdom have you considered using https://github.com/dwyl/hapi-auth-jwt2
which has the correct function signature/documentation...?

@virtualdom what version of the lib are you using? The latest version 3.0 has an updated validate function signature where the request is the first param. See here for the function call.

Got it. Noticed that the example folder in the repo lists "hapi-auth-jwt": "2.x.x" in its package.json, and I changed the require statement in its index.js to use the version in its node_modules. It was running 2.1.2.

Thanks for the clarification!

ok great. I missed updating that version in the example, I'll get that fixed.