Skip to content

Instantly share code, notes, and snippets.

@dylanbathurst
Created May 9, 2012 22:10
Show Gist options
  • Select an option

  • Save dylanbathurst/2649294 to your computer and use it in GitHub Desktop.

Select an option

Save dylanbathurst/2649294 to your computer and use it in GitHub Desktop.
var p = this.Promise();
var fieldsQuery = "";
if (this._fields && this._fields.length > 0){
fieldsQuery = "?fields=" + this.fields();
}
this.oauth.get(this.apiHost() + '/me' + fieldsQuery, accessToken, function (err, data) {
if (err)
return p.fail(err);
var oauthUser = JSON.parse(data);
p.fulfill(oauthUser);
})
return p;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment