Skip to content

Commit

Permalink
waterlock#9; Facebook fields are not being requested from Graph API p…
Browse files Browse the repository at this point in the history
…roperly.
  • Loading branch information
nhodges committed May 15, 2016
1 parent 0dc13f9 commit 5f8b315
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/fboauth2.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ FBOAuth2.prototype.get = function(uri, cb){
cb('Access token does not exist!');
}

var url = this._graphAPIURL + uri + '?' + this.toQuery(this.accessToken);
var authConfig = require('./waterlock-facebook-auth').authConfig;
var fields = [];
var fieldMap = authConfig.fieldMap || {};
Object.keys(fieldMap).forEach(function(key) { fields.push(fieldMap[key]); });
if(fields.indexOf('name') < 0) { fields.push('name'); }

var url = this._graphAPIURL + uri + '?' + this.toQuery(this.accessToken) + '&fields=' + fields;

request(url, cb);
};

0 comments on commit 5f8b315

Please sign in to comment.