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

Commit

Permalink
Treat any status other than 201 as error
Browse files Browse the repository at this point in the history
  • Loading branch information
ankon committed Feb 1, 2016
1 parent ea20f70 commit b772279
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 b772279

Please sign in to comment.