-
Notifications
You must be signed in to change notification settings - Fork 17
authorize endpoint: Uncaught error: reply interface called twice #14
Comments
Looks like it's due to some inconsistent error-handling around here: https://github.com/blinkmobile/hapi-oauth2orize/blob/master/index.js#L81-L98 . Your code generated an error which propagated down into a duplicate call to |
Yes, the error inconsistently handled is that I was missing ?response_type= in the call. Now I'm getting the same "reply called twice" because of a simple error of "cannot read property find of undefined", I suppose I need to create my own models now for clients, tokens, etc... instead of using the example code :) Do you have any suggestion how to fix this error? Any related documentation or approach? My approach would be modifying the callback of authorize(request, reply, callback(req, res)) so it passes a variable called error with req and es and then we can if/else the two different replies with error or view. Comments welcome! |
I have improved the code a little bit with this in my code (modifying the example code from README and commenting a line in index.js (169)) Comment this line, so we can see the actual error message: Modify the oauth.authorize() callback like this, adding if(!request.response.isBoom)
So far working for me... but I'm showing some internal errors in the API output haha. |
Hello,
This is my code for controllers/oauth2.js where I have the handler for '/oauth/authorize'
In the third line I get this error stack trace:
Any ideas how we fix this?
The text was updated successfully, but these errors were encountered: