Skip to content

Commit

Permalink
Schwab 2fa optional
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonDane committed May 19, 2023
1 parent c56bb7a commit 066659a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions schwabAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ def schwab_init():
# Initialize .env file
load_dotenv()
# Import Schwab account
if not os.getenv("SCHWAB_USERNAME") or not os.getenv("SCHWAB_PASSWORD") or not os.getenv("SCHWAB_TOTP_SECRET"):
if not os.getenv("SCHWAB_USERNAME") or not os.getenv("SCHWAB_PASSWORD"):
print("Schwab not found, skipping...")
return None
SCHWAB_USERNAME = os.environ["SCHWAB_USERNAME"]
SCHWAB_PASSWORD = os.environ["SCHWAB_PASSWORD"]
SCHWAB_TOTP_SECRET = os.environ["SCHWAB_TOTP_SECRET"]
SCHWAB_TOTP_SECRET = os.environ.get("SCHWAB_TOTP_SECRET", None)
print(SCHWAB_TOTP_SECRET)
# Log in to Schwab account
print("Logging in to Schwab...")
try:
Expand Down

0 comments on commit 066659a

Please sign in to comment.