Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #225 from ankon/fix/treat-non-201-as-error
Browse files Browse the repository at this point in the history
Treat any status other than 201 as error
  • Loading branch information
pksunkara committed Feb 1, 2016
2 parents ea20f70 + b772279 commit 6e0b739
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/octonode/auth.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/octonode/auth.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ auth = module.exports =
body = JSON.parse body
catch err
callback new Error('Unable to parse body')
if res.statusCode is 401 then callback(new Error(body.message)) else callback(null, body.id, body.token)
if res.statusCode is 201 then callback(null, body.id, body.token) else callback(new Error(body.message))
else if @mode == @modes.web
if scopes instanceof Array
uri = 'https://github.com/login/oauth/authorize'
Expand Down

0 comments on commit 6e0b739

Please sign in to comment.