index.js 341 B

12345678910111213
  1. module.exports = authenticationPlugin
  2. const authenticate = require('./authenticate')
  3. const beforeRequest = require('./before-request')
  4. function authenticationPlugin (octokit) {
  5. const state = {
  6. auth: false
  7. }
  8. octokit.authenticate = authenticate.bind(null, state)
  9. octokit.hook.before('request', beforeRequest.bind(null, state))
  10. }