Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fetchOAuthUser for facebook module now returns a Promise.

  • Loading branch information...
commit 7200352385d0d6ffd700a07edc09f8dee1777d58 1 parent f085178
@bnoguchi authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/facebook.js
View
5 lib/facebook.js
@@ -1,4 +1,5 @@
-var oauthModule = require('./oauth');
+var oauthModule = require('./oauth')
+ , Promise = require('./promise');
var fb = module.exports =
oauthModule.submodule('facebook')
@@ -16,9 +17,11 @@ oauthModule.submodule('facebook')
return authUri;
})
.fetchOAuthUser( function (accessToken) {
+ var p = new Promise();
this.oauth.getProtectedResource(this.apiHost() + '/me', accessToken, function (err, data, response) {
if (err) return p.error(err);
var oauthUser = JSON.parse(data);
p.fulfill(oauthUser);
})
+ return p;
});
Please sign in to comment.
Something went wrong with that request. Please try again.