Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
37 lines (31 sloc)
722 Bytes
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
| /******************************* | |
| GitHub Login | |
| *******************************/ | |
| /* | |
| Logs into GitHub using OAuth | |
| */ | |
| var | |
| fs = require('fs'), | |
| path = require('path'), | |
| githubAPI = require('github'), | |
| // stores oauth info for GitHub API | |
| oAuthConfig = path.join(__dirname, 'oauth.js'), | |
| oAuth = fs.existsSync(oAuthConfig) | |
| ? require(oAuthConfig) | |
| : false, | |
| github | |
| ; | |
| if(!oAuth) { | |
| console.error('Must add oauth token for GitHub in tasks/config/admin/oauth.js'); | |
| } | |
| github = new githubAPI({ | |
| version : '3.0.0', | |
| debug : true, | |
| protocol : 'https', | |
| timeout : 5000 | |
| }); | |
| github.authenticate({ | |
| type: 'oauth', | |
| token: oAuth.token | |
| }); | |
| module.exports = github; |