私は KeystoneJS を使用しており、oauth2 コードを挿入したいと考えています。
私のトークンとユーザーのコードはすべて問題なく実行されます。メソッドは、console.log を介してトリガーされます。トークンが正常に生成されました。
ただし、戻り値がなく、最終的にクライアントでタイムアウトを受け取ります。
// Setup Route Bindings
exports = module.exports = function(app) {
// Oauth2
var oauth = oauthserver({
model: require('../models/Client'),
grants: ['password', 'refresh_token'],
debug: true });
// Views
app.get('/', routes.views.index);
// both routes below can be triggered correctly, but timeout return
app.all('/oauth/token', oauth.grant());
app.get('/secret', oauth.authorise(), function (req, res) {
res.send('Secret area');
});
};