Skip to content

Instantly share code, notes, and snippets.

@johnmdonahue
Created June 12, 2012 20:04
Show Gist options
  • Save johnmdonahue/2919806 to your computer and use it in GitHub Desktop.
Save johnmdonahue/2919806 to your computer and use it in GitHub Desktop.
GitHub API v3 everyauth Shim
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