diff --git a/lib/strategy.js b/lib/strategy.js index 0f4b07f..ef96581 100644 --- a/lib/strategy.js +++ b/lib/strategy.js @@ -135,7 +135,7 @@ Strategy.prototype.userProfile = function(accessToken, done) { if (self._scope && self._scope.indexOf('user:email') !== -1) { - self._oauth2._request('GET', self._userProfileURL + '/emails', { 'Accept': 'application/vnd.github.v3+json' }, '', accessToken, function(err, body, res) { + self._oauth2._request('GET', self._userProfileURL + '/emails', { 'Accept': 'application/vnd.github.v3+json', 'Authorization': 'token ' + accessToken }, '', accessToken, function(err, body, res) { if (err) { // If the attempt to fetch email addresses fails, return the profile // information that was obtained.