Created
July 12, 2018 23:09
-
-
Save d3vild06/77281d8232c8165b98555d4cce0a92b2 to your computer and use it in GitHub Desktop.
GitHub Auth Revoke
This file contains 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
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