Socket
Socket
Sign inDemoInstall

auth-routes

Package Overview
Dependencies
42
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    auth-routes

Helpful authentication routes for Node.js GitHub integrations


Version published
Maintainers
1
Install size
3.87 MB
Created

Readme

Source

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

NameDescriptionRequiredDefault
client_idGitHub App's Client ID-
client_secretGitHub App's Client Secret-
loginURLLogin path'/login'
callbackURLAuthorization callback URL, for your GitHub App'/login/cb'
afterLoginWhere users are redirected to after they've logged in'/'

Keywords

FAQs

Last updated on 13 Dec 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc