Permalink
Browse files

Merge pull request #80 from jgable/twoFactorAuth

Allow passing One Time Password to login
  • Loading branch information...
2 parents 3544f51 + 651dae8 commit 5ea4b1c847dcdce40dd6bc721548fab79638a713 @pksunkara committed Dec 14, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/octonode/auth.coffee
View
@@ -55,6 +55,10 @@ auth = module.exports =
'Content-Type': 'application/json'
'User-Agent': 'octonode/0.3 (https://github.com/pksunkara/octonode) terminal/0.0'
options.url.auth = "#{@options.username}:#{@options.password}"
+
+ # Check for a one time password (for two factor authentication)
+ if @options.otp then options.headers['X-GitHub-OTP'] = @options.otp
+
request options, (err, res, body) ->
if err?
callback err

0 comments on commit 5ea4b1c

Please sign in to comment.