Skip to content

Instantly share code, notes, and snippets.

@d3vild06
Created July 12, 2018 23:09
Show Gist options
  • Save d3vild06/77281d8232c8165b98555d4cce0a92b2 to your computer and use it in GitHub Desktop.
Save d3vild06/77281d8232c8165b98555d4cce0a92b2 to your computer and use it in GitHub Desktop.
GitHub Auth Revoke
githubAuthRevoke = function(accessToken) {
check(accessToken, String);
console.log("in githubAuthRevoke");
let clientId = Meteor.settings.github_clientid
let clientSecret = Meteor.settings.github_clientsecret
let options = {
headers: {
'User-Agent': 'CodeBuddies'
},
'auth': `${clientId}:${clientSecret}`
}
let response = HTTP.del(`https://api.github.com/applications/${clientId}/grants/${accessToken}`, options, (err, result) => {
if (!err) {
return true
}
console.log(`err: ${err}`)
return false
})
return response
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment