Created
June 12, 2012 20:04
-
-
Save johnmdonahue/2919806 to your computer and use it in GitHub Desktop.
GitHub API v3 everyauth Shim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var everyauth = require('everyauth') | |
everyauth.github | |
.apiHost('https://api.github.com') | |
.fetchOAuthUser(function (accessToken) { | |
var p = this.Promise() | |
this.oauth.get(this.apiHost() + '/user', 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