Skip to content

Commit

Permalink
Merge branch '2fa' of git://github.com/Carreau/gitsome into Carreau-2fa
Browse files Browse the repository at this point in the history
* '2fa' of git://github.com/Carreau/gitsome:
  Support two factor authentication.
  • Loading branch information
donnemartin committed May 14, 2016
2 parents 034ded0 + 0d5a032 commit 2dfb4b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gitsome/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,16 @@ def authenticate(self, overwrite=False):
self.user_pass = self.getpass('Password: ')
try:
# Get an authorization for this
def twofa():
return self.getpass('One time password: ')

auth = self.authorize(
self.user_login,
self.user_pass,
scopes=['user', 'repo'],
note='gitsome',
note_url='https://github.com/donnemartin/github-cli'
note_url='https://github.com/donnemartin/github-cli',
two_factor_callback=twofa
)
self.user_token = auth.token
except UnprocessableEntity:
Expand Down

0 comments on commit 2dfb4b2

Please sign in to comment.