Created
December 17, 2017 19:52
-
-
Save balthazar/e9bdc2cae57efcd5614a3570ff5ecd89 to your computer and use it in GitHub Desktop.
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
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