-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cb is not a function in hapi.js #3742
Comments
This is clearly not a problem with hapi itself but with the modules you're using. Have you read the issue template before posting ? |
I am running into the same problem. I just found this thread and wanted to clarify for him. This is the tutorial he's referring to: I know hapi.js has authentication built in. The approach mentioned in this article is brand specific to auth0. I'm sure there is a more general way. I will be looking for it in the documentation and starting there. |
The problem is written in the tutorial:
The module doesn't work with hapi 17. You can try hapi 16 I guess. EDIT: The PR in question is dwyl/hapi-auth-jwt2#249 |
I'm having the same issue I have identified it down to this function here https://github.com/auth0/node-jwks-rsa/blob/master/src/integrations/hapi.js#L24 not working with the v17 branch. I'll see what I can do and try and submit a PR somewhere that makes sense. |
I'm only a novice but I think the problem is that the validate_user method uses old style callbacks instead of the new hapi response toolkit.
|
I still have same issues, how did you solve this?
I tried to follow this example: Not working either, I'm using these versions.
I even created a issue on hapi-auth-jwt2. |
@jamalsoueidan change this line
to this
|
@aronsuarez I get
|
The code below is tested and running with the following packages:
|
I'm following this tutorial to implement jwt authentication in hapijs v17.2.
I did everything according to the tutorial, but the following error is driving me crazy, even debugging didn't make any change.
Error
app.js
When I make a request to routes with auth: false, the handler works properly then I get the expected result, but requests to routes without auth return the following json :
More info:
node version: 8.9.4
npm version: 5.6.0
hapi version: 17.2.0
hapi-auth-jwt2: github:salzhrani/hapi-auth-jwt2#v-17
jwks-rsa: 1.2.1
mongoose: 5.0.6
nodemon: 1.15.0
The text was updated successfully, but these errors were encountered: