Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/probot/auth-routes
🔀🔒 Helpful authentication routes for Node.js GitHub integrations
https://github.com/probot/auth-routes
github github-integration probot
Last synced: 3 months ago
JSON representation
🔀🔒 Helpful authentication routes for Node.js GitHub integrations
- Host: GitHub
- URL: https://github.com/probot/auth-routes
- Owner: probot
- License: isc
- Created: 2018-04-04T18:29:24.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-11T06:02:36.000Z (4 months ago)
- Last Synced: 2024-09-26T20:46:16.501Z (4 months ago)
- Topics: github, github-integration, probot
- Language: TypeScript
- Homepage:
- Size: 282 KB
- Stars: 13
- Watchers: 2
- Forks: 11
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
GitHub Auth Routes
Helpful authentication routes for Node.js GitHub integrations
## Install
```bash
$ npm install auth-routes
```## Usage
```js
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
```js
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 | | `'/'` |