Skip to content

Commit

Permalink
Merge pull request #43 from natekspencer/dev
Browse files Browse the repository at this point in the history
Capture additional authentication error details
  • Loading branch information
natekspencer authored Dec 9, 2022
2 parents bef0945 + 48f42cf commit 0b70bd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vivintpy/vivintskyapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,13 @@ async def __call(
return resp_data
if resp.status == 302:
return {"location": resp.headers.get("Location")}
if resp.status == 401:
if resp.status in (400, 401, 403):
message = (
resp_data.get(MfaVerificationResponse.MESSAGE)
if is_mfa_request
else resp_data.get(AuthenticationResponse.MESSAGE)
)
if message == AuthenticationResponse.MFA_REQUIRED:
if message == AuthenticationResponse.MFA_REQUIRED or is_mfa_request:
self.__mfa_pending = True
raise VivintSkyApiMfaRequiredError(message)
raise VivintSkyApiAuthenticationError(message)
Expand Down

0 comments on commit 0b70bd4

Please sign in to comment.