nodejs ( npm ) 用の oauth2-server プラグインを使用しており、次の構成があります。
app.oauth = oauthserver({
model: oauth.model,
grants: ['password'],
debug: false
});
(ヘッダーなし、クエリなし、本文なし) のパラメーターを送信せずに /oauth/token を GET すると、次のエラーが 500 - 内部サーバー エラーとして表示されます。
{
"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"
}
メッセージのコードには 400 (Bad Request) と表示されていますが、メッセージを 500 ではなく 400 応答として送信したいと考えています。
さらに、構成として debug: false があるにもかかわらず、コンソールにエラーが表示されます。どうすればそれを変更できますか?