jmfernandes / robin_stocks

This is a library to use with Robinhood Financial App. It currently supports trading crypto-currencies, options, and stocks. In addition, it can be used to get real time ticker information, assess the performance of your portfolio, and can also get tax documents, total dividends paid, and more. More info at
http://www.robin-stocks.com
MIT License
1.69k stars 459 forks source link

Able to login using wrong id and password if robinhood.pickle already exists in local #202

Open stockanalysisapp opened 3 years ago

stockanalysisapp commented 3 years ago

I was able to login using wrong id and password if robinhood.pickle was already created by the previous id and password. I had to remove 'robinhood.pickle' in the pickle_path. Before I removed the file, I was able to login with any id and password. For example, I could retrieve all holdings by simply running r.login() without any parameters.

home_dir = os.path.expanduser("~")
data_dir = os.path.join(home_dir, ".tokens")
creds_file = "robinhood.pickle"
pickle_path = os.path.join(data_dir, creds_file)
if os.path.isfile(pickle_path):
    os.remove(pickle_path)
Alex-Bishka commented 3 years ago

@stockanalysisapp I experience the same problem. And @lalliexperience I believe it is some sort of API thing, as robinhood seems to send an sms in order to confirm creation of the pickle file.

It would be nice if store_session=False would allow you to login without creation of the pickle (and needing the sms), because it is creating a big pain for my scripts.