Skip to content

Commit

Permalink
fix: github provider (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmschneider authored and pi0 committed Apr 28, 2018
1 parent cfc57f3 commit 8b1819f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions docs/providers/github.md
Expand Up @@ -8,7 +8,8 @@
auth: {
strategies: {
github: {
client_id: '...'
client_id: '...',
client_secret: '...'
},
}
}
Expand All @@ -22,7 +23,7 @@ this.$auth.loginWith('github')

💁 This provider is based on [oauth2 scheme](../schemes/oauth2.md) and supports all scheme options.

### Obtaining `client_id`
### Obtaining `client_id` and `client_secret`

This option is **REQUIRED**. To obtain one, create your app in [Create a new Oauth APP](https://github.com/settings/applications/new) and use provided "Client ID".
This option is **REQUIRED**. To obtain one, create your app in [Create a new Oauth APP](https://github.com/settings/applications/new) and use provided "Client ID" and "Client Secret".

6 changes: 3 additions & 3 deletions lib/providers/_utils.js
Expand Up @@ -21,8 +21,8 @@ function addAuthorize (strategy) {
// Set response_type to code
strategy.response_type = 'code'

// Json parser
const jsonMiddleware = bodyParser.json()
// Form data parser
const formMiddleware = bodyParser.urlencoded()

// Register endpoint
this.options.serverMiddleware.unshift({
Expand All @@ -32,7 +32,7 @@ function addAuthorize (strategy) {
return next()
}

jsonMiddleware(req, res, () => {
formMiddleware(req, res, () => {
const { code } = req.body

if (!code) {
Expand Down

0 comments on commit 8b1819f

Please sign in to comment.