Skip to content

Commit

Permalink
2FA Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
aamazie authored May 6, 2019
1 parent 3f04e9c commit 3dd17a2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Robinhood/Robinhood.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,18 @@ def login(self,
self.username = username
self.password = password

if self.device_token == "": #needs to have 2FA off or won't send SMS
self.GenerateDeviceToken()

if qr_code:
self.mfa_code = self.get_mfa_token(qr_code)
payload = {
'password': self.password,
'username': self.username,
'grant_type': 'password',
'client_id': "c82SH0WZOsabOXGP2sxqcj34FxkvfnWRZBKlBjFS",
'scope': 'internal',
'device_token': self.device_token,
'mfa_code': self.mfa_code
}

Expand All @@ -151,9 +156,6 @@ def login(self,
raise RH_exception.LoginFailed()

else:
if self.device_token == "": #needs to have 2FA off or won't send SMS
self.GenerateDeviceToken()

payload = {
'password': self.password,
'username': self.username,
Expand Down Expand Up @@ -202,6 +204,8 @@ def auth_method(self):
'username': self.username,
'grant_type': 'password',
'client_id': "c82SH0WZOsabOXGP2sxqcj34FxkvfnWRZBKlBjFS",
'scope': 'internal',
'device_token': self.device_token,
'mfa_code': self.mfa_code
}

Expand Down

0 comments on commit 3dd17a2

Please sign in to comment.