Skip to content

Commit

Permalink
Don't check credentials if WB_AUTH=false #1355
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlt8 committed Oct 2, 2024
1 parent c4f5878 commit 3e336bc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/wyzebridge/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,14 @@ def _update_credentials(cls, email: str, force: bool = False) -> None:

@classmethod
def auth_onvif(cls, creds: Optional[dict]) -> bool:
if not cls.enabled:
return True

if creds and creds.get("username") == "wb":
hashed = onvif_hash(creds["nonce"], creds["created"], cls.api)
return hashed == creds.get("password")

return cls.enabled is False
return False


def onvif_hash(nonce, created, password) -> str:
Expand Down

0 comments on commit 3e336bc

Please sign in to comment.