Skip to content

Commit

Permalink
fix: delete bad cookies on failed login
Browse files Browse the repository at this point in the history
This will reset the session and clear the old cookies. This may be
necessary to avoid a bad login state.
fixes #699
  • Loading branch information
alandtse committed May 23, 2020
1 parent ff3c9ed commit 162a572
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions custom_components/alexa_media/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ async def async_update_data():
hass, config_entry, login_obj, setup_alexa
):
login_obj.status = {}
await login_obj.reset()
await login_obj.login()
return
except BaseException as err:
Expand Down
1 change: 1 addition & 0 deletions custom_components/alexa_media/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ async def wrapper(*args, **kwargs) -> Any:
hass, config_entry, login, setup_alexa
):
login.status = {}
await login.reset()
await login.login()
return None
return result
Expand Down

0 comments on commit 162a572

Please sign in to comment.