Skip to content

Commit

Permalink
Ignore WB_API if WB_AUTH is disabled #1304
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlt8 committed Jul 23, 2024
1 parent 9f8c7df commit 14ea80a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ You can then use the web interface at `http://localhost:5000` where localhost is

See [basic usage](#basic-usage) for additional information or visit the [wiki page](https://github.com/mrlt8/docker-wyze-bridge/wiki/Home-Assistant) for additional information on using the bridge as a Home Assistant Add-on.

## What's Changed in v2.10.0
## What's Changed in v2.10.0/v2.10.1

FIXED: Could not disable `WB_AUTH` if `WB_API` is set. (#1304)

### WebUI Authentication

Expand Down
5 changes: 2 additions & 3 deletions app/wyzebridge/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def gen_api_key(email):
class WbAuth:
enabled: bool = bool(env_bool("WB_AUTH") if os.getenv("WB_AUTH") else True)
username: str = get_secret("wb_username", "wbadmin")
api: str = get_credential("wb_api")
api: str = ""
_pass: str = get_credential("wb_password")
_hashed_pass: Optional[str] = None

Expand Down Expand Up @@ -80,8 +80,7 @@ def _update_credentials(cls, email: str, force: bool = False) -> None:
cls._pass = email.partition("@")[0]
cls._hashed_pass = generate_password_hash(cls._pass)

if not get_credential("wb_api"):
cls.api = gen_api_key(email)
cls.api = get_credential("wb_api") or gen_api_key(email)


STREAM_AUTH: str = env_bool("STREAM_AUTH", style="original")
4 changes: 3 additions & 1 deletion home_assistant/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## What's Changed in v2.10.0
## What's Changed in v2.10.0/v2.10.1

FIXED: Could not disable `WB_AUTH` if `WB_API` is set. Thanks @bengthu! (#1304)

### WebUI Authentication

Expand Down

0 comments on commit 14ea80a

Please sign in to comment.