While working on #35 i noticed, the actual request callback implementation in authenticate functions swallows quite a lot of errors returned by gihub.
Eg. when providing a bad code, res.on('end', ..) will be called and just returns an empty error obejct and an null token.
Only way I could get actual errors was when the request timed out.
// .. Relevant code in authenticate function in server.js
var req = https.request(reqOptions, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) { body += chunk; });
res.on('end', function() {
cb(null, qs.parse(body).access_token);
});
});
//..
While working on #35 i noticed, the actual request callback implementation in authenticate functions swallows quite a lot of errors returned by gihub. Eg. when providing a bad code, res.on('end', ..) will be called and just returns an empty error obejct and an null token.
Only way I could get actual errors was when the request timed out.