Skip to content

Commit

Permalink
Fix 2FA 400 Error
Browse files Browse the repository at this point in the history
Fix for #83
  • Loading branch information
mrlt8 committed Aug 22, 2021
1 parent a4122fe commit 9c205a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ If you wish to continue using your camera with the bridge, you should downgrade
| V3 | 4.36.2.5 (June 14, 2021) | ✅ 4.36.2.5 |
| PAN | 4.10.6.241 (March 9, 2021) | ❌ 4.10.7.798 |

## Changes in v0.5.11

- Fix bug in 2FA when submitting verification resulted in "400" Error

## Changes in v0.5.10

- Check for DTLS status instead of firmware version for compatibility
Expand Down
7 changes: 5 additions & 2 deletions app/wyze_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

class wyze_bridge:
def __init__(self):
print("\n🚀 STARTING DOCKER-WYZE-BRIDGE v0.5.10")
print("\n🚀 STARTING DOCKER-WYZE-BRIDGE v0.5.11")
if "DEBUG_LEVEL" in os.environ:
print(f'DEBUG_LEVEL set to {os.environ.get("DEBUG_LEVEL")}')
debug_level = getattr(logging, os.environ.get("DEBUG_LEVEL").upper(), 10)
Expand Down Expand Up @@ -92,6 +92,9 @@ def auth_wyze(self):
)
sms_resp.raise_for_status()
self.log.info(f"💬 SMS code requested")
json_resp["mfa_options"] = "PrimaryPhone"
else:
json_resp["mfa_options"] = "TotpVerificationCode"
while True:
if os.path.exists(mfa_token) and os.path.getsize(mfa_token) > 0:
with open(mfa_token, "r+") as f:
Expand All @@ -106,7 +109,7 @@ def auth_wyze(self):
"password": wyzecam.api.triplemd5(
os.environ["WYZE_PASSWORD"]
),
"mfa_type": json_resp["mfa_options"][0],
"mfa_type": json_resp["mfa_options"],
"verification_id": sms_resp.json()["session_id"]
if "sms_resp" in vars()
else json_resp["mfa_details"]["totp_apps"][0][
Expand Down

0 comments on commit 9c205a6

Please sign in to comment.