I am using the oauth2-server plugin for nodejs (npm) and have the following configuration:
app.oauth = oauthserver({
model: oauth.model,
grants: ['password'],
debug: false
});
When I GET /oauth/token without sending any parameter with (no header, no query, no body), I get the following error as an 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 the message says 400 (Bad Request) and I want to send the message not as a 500 but 400 response.
Additionally I get the error on my console even though I have debug: false as configuration. How can I change that?