Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

Fix 400 error on mfa authentication #90

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions fast_arrow/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import os
import uuid

import requests
from fast_arrow.util import get_last_path
from fast_arrow.resources.account import Account
Expand Down Expand Up @@ -111,6 +113,7 @@ def login_oauth2(self, username, password, mfa_code=None):
Login using username and password
'''
data = {
"device_token": uuid.uuid4(),
"grant_type": "password",
"scope": "internal",
"client_id": CLIENT_ID,
Expand Down
3 changes: 2 additions & 1 deletion fast_arrow/resources/option_position.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ def all(cls, client, **kwargs):
max_date = kwargs['max_date'] if 'max_date' in kwargs else None
max_fetches = \
kwargs['max_fetches'] if 'max_fetches' in kwargs else None
nonzero = kwargs.get('nonzero', False)

url = 'https://api.robinhood.com/options/positions/'
params = {}
params = {'nonzero': nonzero}
data = client.get(url, params=params)
results = data["results"]

Expand Down