Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMS prompt not being displayed, something changed within last 6 months :/ #534

Open
Kungpaoshizi opened this issue Jan 12, 2025 · 1 comment

Comments

@Kungpaoshizi
Copy link

Kungpaoshizi commented Jan 12, 2025

Apologies, a little rusty as it's been awhile. Below is execution/print(e)/etc. This is after a fresh uninstall/reinstall via pip.

MainMenu()
login(days=1)
Program_StartTime = datetime.datetime.now()

my login code:
........
def login(days):
try:
time_logged_in = 606024*days
rh.authentication.login(username=input("Enter email or Press Ctrl+C Twice To Exit:"),
password=input("Pass:"),
expiresIn=time_logged_in,
scope='internal',
by_sms=True,
store_session=False)
print('Login Successful')
except Exception as e:
print('ErrorLoggingIn')
time.sleep(5)

def get_cash():
try:
rh_cash = rh.account.build_user_profile()
etc....
.......

Failure below, console output:

Enter email or Press Ctrl+C Twice To Exit:********************
Pass:*****************

ErrorLoggingIn (Right here, after submitting email and password I successfully get the sms with the code, but rh.auth.login doesn't prompt for sms anymore after rh change or robin_stocks update and just fails out? I think that's what I'm seeing)

Exception from within authentication.login(): 'status'
get_cash Failure
build_user_profile can only be called when logged in
Now Killing process...
Traceback (most recent call last):
File "/home/machine/Desktop/bot/Bot.py", line 1145, in get_cash
rh_cash = rh.account.build_user_profile()
File "/home/machine/.local/lib/python3.9/site-packages/robin_stocks/robinhood/helper.py", line 31, in login_wrapper
raise Exception('{} can only be called when logged in'.format(
Exception: build_user_profile can only be called when logged in

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/machine/Desktop/bot/Bot.py", line 15497, in
Cash = get_cash()
File "/home/machine/Desktop/bot/Bot.py", line 1163, in get_cash
os.kill(os.getpid(), signal.SIGINT)
KeyboardInterrupt

@ehali
Copy link

ehali commented Jan 12, 2025

This pull request (#526) will fix the issue where you are no longer prompted for the MFA code by your login script.

After you implement the change let me know if it works entirely for you or you get a little further but run into another issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants