Closed akibnizam closed 1 year ago
Can you tell me which version of the package you are using?
>>> import pyrh
>>> pyrh.__version__
@adithyabsk thanks for getting back so quickly!
It is '2.0.1'
That's really strange--don't seem to be having that issue on my end. Just pushed the latest code to pypi
so I'd be able to better debug, can you downloaded the latest version of the package 2.1.1
?
Reinstalled latest version but still same error :/
I get the following notification on the app to verify if it is me trying to access since i have "Device approvals" under 2FA ->
yeah not sure. maybe it has something to do with your locale, and the return code from robinhood. If you install the project from source and throw a breakpoint import pdb; pdb.set_trace()
before marshmallow does the deserialization, we might be able to figure out more about what's going wrong. Specifically, before line 290
in your error traceback.
Gotcha! I will do the debugging
So I looked at the issue before line 290
in sessionmanager.py
and seems like after sending post request in at 273
I am getting response -
b'{"detail":"Request blocked, prompt challenge issued.","challenge":{"id":"_random id here_","user":"eaxxxxxxx","type":"prompt","alternate_type":"sms","status":"issued","remaining_retries":3,"remaining_attempts":1,"expires_at":"2023-01-24T02:54:56.445001-05:00","updated_at":"2023-01-24T02:49:56.445342-05:00","flow_id":"login","mfa_status":"prompt","silent":false,"silent_factor_id":null}}'
Issue resolved! The problem was that I had "device approval" option enabled for 2FA and so everytime I was accessing through api, RH was asking a trusted device (my phone) for approval but by that time the request is denied to my api.
Solved it by changing to text based 2FA or 3rd party authenticator.
@akibnizam glad it's resolved. If you have the time it would be great to throw up a quick PR to catch this error and display a more meaningful error code. (ie parse the additional response type from Robinhood and say it's not supported)
@adithyabsk sounds good! I will make a PR related to it
I have the following lines -
And then I get the following error ->
Is there something I am missing?