Skip to content

Commit

Permalink
Add support for corporate GitHubs
Browse files Browse the repository at this point in the history
  • Loading branch information
rragan committed Feb 28, 2013
1 parent 2e630d0 commit 6747e53
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/passport-github/strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ function Strategy(options, verify) {
options.tokenURL = options.tokenURL || 'https://github.com/login/oauth/access_token';
options.scopeSeparator = options.scopeSeparator || ',';

this.userProfileURL = options.userProfileURL || 'https://api.github.com/user';
OAuth2Strategy.call(this, options, verify);
this.name = 'github';
}
Expand Down Expand Up @@ -76,7 +77,10 @@ util.inherits(Strategy, OAuth2Strategy);
* @api protected
*/
Strategy.prototype.userProfile = function(accessToken, done) {
this._oauth2.get('https://api.github.com/user', accessToken, function (err, body, res) {
// this._oauth2.get('https://api.github.com/user', accessToken, function (err, body, res) {
var url = this.userProfileURL;
//this._oauth2.get('https://github.paypal.com/api/v3/user', accessToken, function (err, body, res) {
this._oauth2.get(url, accessToken, function (err, body, res) {
if (err) { return done(new InternalOAuthError('failed to fetch user profile', err)); }

try {
Expand Down

0 comments on commit 6747e53

Please sign in to comment.