auth-routes
Helpful authentication routes for Node.js GitHub integrations
Last updated 8 months ago by jasonetco .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install auth-routes 
SYNC missed versions from official npm registry.

GitHub Auth Routes

Helpful authentication routes for Node.js GitHub integrations

NPM Build Status Codecov

Usage

const { registerAuthRoutes } = require('auth-routes')

const app = express()
registerAuthRoutes(app, {
  client_id: process.env.GITHUB_CLIENT_ID,
  client_secret: process.env.GITHUB_CLIENT_SECRET
})

// Or pass some options:
registerAuthRoutes(app, {
  loginURL: '/log-me-in',
  callbackURL: '/call-me-back',
  client_id: process.env.GITHUB_CLIENT_ID,
  client_secret: process.env.GITHUB_CLIENT_SECRET
})

Use with Probot

module.exports = app => {
  // Access the Express server that Probot uses
  const expressApp = app.route()

  // Register the routes as normal
  registerAuthRoutes(expressApp, {
    client_id: process.env.GITHUB_CLIENT_ID,
    client_secret: process.env.GITHUB_CLIENT_SECRET
  })
}

Options

Name Description Required Default
client_id GitHub App's Client ID -
client_secret GitHub App's Client Secret -
loginURL Login path '/login'
callbackURL Authorization callback URL, for your GitHub App '/login/cb'
afterLogin Where users are redirected to after they've logged in '/'

Current Tags

  • 0.0.1                                ...           latest (8 months ago)

1 Versions

  • 0.0.1                                ...           8 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (2)
Dev Dependencies (16)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |