node.js - REST interface from oauth2-server errors in nodejs -


i using oauth2-server plugin nodejs (npm) , have following configuration:

app.oauth = oauthserver({     model: oauth.model,     grants: ['password'],     debug: false }); 

when /oauth/token without sending parameter (no header, no query, no body), following error 500 - internal server error:

{     "name": "oauth2error",     "message": "invalid or missing grant_type parameter",     "headers": {         "cache-control": "no-store",         "pragma": "no-cache"     },     "code": 400,     "error": "invalid_request",     "error_description": "invalid or missing grant_type parameter" } 

the code in message says 400 (bad request) , want send message not 500 400 response.

additionally error on console though have debug: false configuration. how can change that?


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -