Skip to content

Commit

Permalink
Make userProfileURL an option.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Feb 3, 2016
1 parent a4318ca commit 900effe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/oauth2.js
Expand Up @@ -52,6 +52,7 @@ function Strategy(options, verify) {

OAuth2Strategy.call(this, options, verify);
this.name = 'google';
this._userProfileURL = options.userProfileURL || 'https://www.googleapis.com/plus/v1/people/me';

//warn deprecated scopes
if (this._scope) {
Expand Down Expand Up @@ -87,7 +88,7 @@ util.inherits(Strategy, OAuth2Strategy);
Strategy.prototype.userProfile = function(accessToken, done) {
// TODO: Switch to new URL:
// https://www.googleapis.com/oauth2/v3/userinfo
this._oauth2.get('https://www.googleapis.com/plus/v1/people/me', accessToken, function (err, body, res) {
this._oauth2.get(this._userProfileURL, accessToken, function (err, body, res) {
if (err) { return done(new InternalOAuthError('failed to fetch user profile', err)); }

try {
Expand Down

0 comments on commit 900effe

Please sign in to comment.