来自nodejs中的oauth2-server错误的REST接口

我正在使用nodejs( npm )的oauth2-server插件,并具有以下configuration:

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

当我GET / oauth /令牌没有发送任何参数(没有头,没有查询,没有正文),我得到以下错误为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(错误的请求),我想发送的消息不是500而是400响应。

此外,我得到我的控制台上的错误,即使我有debug:false作为configuration。 我怎样才能改变呢?