hammem / monarchmoney

Python API for Monarch Money
MIT License
153 stars 28 forks source link

Bad MFA on interactive login throwing Unknown #114

Open jeeftor opened 2 months ago

jeeftor commented 2 months ago

When you enter a bad MFA we're getting a 404 for resp.status but the parsing of the error code isn't correct

It appears this code block is incorrect:

image

And we need to raise an MFA exception instead of an "Unknown error"

image

aka:

image

Maybe something like:

if response["detail"] == 'Your code was invalid, please try again or use a recovery token.':
   raise RequireMFAException("Your code was invalid, please try again or use a recovery token")

or

if 'please try again' in response['detail']:
   raise RequireMFAException("Your code was invalid, please try again or use a recovery token")
jeeftor commented 2 months ago

Yes I've verified this in the browser as well:

MFA Required initial error

image

Bad MFA Given:

image image