Compare commits
2 Commits
2f58206fbd
...
5ee92a8fe6
Author | SHA1 | Date | |
---|---|---|---|
5ee92a8fe6 | |||
700bf5fed9 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -1 +1,2 @@
|
||||
.env
|
||||
.env
|
||||
__pycache__/
|
@ -10,7 +10,7 @@ load_dotenv()
|
||||
|
||||
class TradeStationClient:
|
||||
|
||||
def __init__(self) -> None:
|
||||
def __init__(self, refresh_token: str = None) -> None:
|
||||
self.id = getenv('TRADESTATION_CLIENT_ID')
|
||||
self.redirect_uri = getenv('TRADESTATION_REDIRECT_URI')
|
||||
self.scope = getenv('TRADESTATION_CLIENT_SCOPE')
|
||||
@ -23,6 +23,11 @@ class TradeStationClient:
|
||||
self.id_token = None
|
||||
self.refresh_token = None
|
||||
|
||||
# For bypassing normal authorization flow.
|
||||
if refresh_token:
|
||||
self.refresh_token = refresh_token
|
||||
self.refresh_access_token()
|
||||
|
||||
def open_authorization_url(self):
|
||||
"""
|
||||
Open the TradeStation authorization URL in the default web browser.
|
||||
|
Loading…
Reference in New Issue
Block a user