You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Log all incoming requests (including the request's response body)".
Even if there is the option continueMiddleware to continue executing a following middleware, it isn't possible to access the response of the token() method in that next middleware. Because of that, I can't easily log the response of the API method to obtain a token.
Maybe it would be feasible to store the response body inside the res object before send it in order to be able to have access it in the following middlewares of the chain.
Alternatively, an option could be added to just obtaining the response body of oauth-node-server but not sending it over automatically.
The text was updated successfully, but these errors were encountered:
esteban-filardi
changed the title
Sent response body cannot be easily be accessible in continuing middlewares
Sent response body cannot be easily accessible in continuing middlewares
Mar 6, 2020
I am looking for something similar.
The token() method returns an error in the following format in case a wrong set of credentials is used. { "error": "invalid_grant", "error_description": "Invalid grant: user credentials are invalid" }
What I intend to do is to return an appropriate error_description depending on the reason for grant failure. Example: User account does not exist. User account is not verified. Incorrect password.
Does anyone have any idea of how I could achieve this?
The requirement for my app is the following:
"Log all incoming requests (including the request's response body)".
Even if there is the option continueMiddleware to continue executing a following middleware, it isn't possible to access the response of the token() method in that next middleware. Because of that, I can't easily log the response of the API method to obtain a token.
Maybe it would be feasible to store the response body inside the res object before send it in order to be able to have access it in the following middlewares of the chain.
Alternatively, an option could be added to just obtaining the response body of oauth-node-server but not sending it over automatically.
The text was updated successfully, but these errors were encountered: