Skip to content

Instantly share code, notes, and snippets.

@balthazar
Created December 17, 2017 19:52
Show Gist options
  • Save balthazar/e9bdc2cae57efcd5614a3570ff5ecd89 to your computer and use it in GitHub Desktop.
Save balthazar/e9bdc2cae57efcd5614a3570ff5ecd89 to your computer and use it in GitHub Desktop.
import q from 'q'
import passport from 'passport'
import { Strategy } from 'passport-github'
import Github from 'github'
passport.use(
new Strategy({ clientID: CLIENT_ID, clientSecret: CLIENT_SECRET },
async (req, accessToken, refreshToken, profile, done) => {
const github = new Github({ version: '3.0.0' })
github.authenticate({ type: 'token', token: accessToken })
await q.nfcall(github.activity.starRepo, {
owner: OWNER,
repo: REPO,
})
done()
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment