This repository has been archived on 2024-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
calcifer/web/semantic/tasks/config/admin/github.js
Tim Schumacher 2027b94179 Update Semantic
Fixes #40,#24
2015-03-29 19:33:23 +02:00

38 lines
No EOL
744 B
JavaScript

/*******************************
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.log('here');
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;