Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function initializeGitHubApp() {
if (!config.github) {
logger.warn('GitHub integration not initialized, missing config.')
return
}
const { id, privateKey, clientId, clientSecret } = config.github
if (!(id && privateKey && clientId && clientSecret)) {
logger.warn('Invalid GitHub config, not initialized.')
return
}
githubApp = new App({ id, privateKey })
githubAuth = new ClientOAuth2({
clientId,
clientSecret,
accessTokenUri: 'https://github.com/login/oauth/access_token',
authorizationUri: 'https://github.com/login/oauth/authorize',
redirectUri: `${config.siteUrl}/api/github/oauth2callback`,
})
}