Skip to content

Commit

Permalink
Fixed: Full logout if no session before trying again.
Browse files Browse the repository at this point in the history
  • Loading branch information
basrieter committed Nov 19, 2023
1 parent c8f2c8e commit a918a1f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions channels/channel.nos/nos2010/chn_nos2010.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ def __log_on(self, force_log_off=False):
""" Makes sure that we are logged on. """

def log_out_npo():
# Old cookies
UriHandler.delete_cookie(domain=".npostart.nl")
UriHandler.delete_cookie(domain=".npo.nl")
UriHandler.delete_cookie(domain="www.npostart.nl")
# New cookies
UriHandler.delete_cookie(domain="id.npo.nl")
UriHandler.delete_cookie(domain="npo.nl")
AddonSettings.set_channel_setting(self, "previous_username", username, store=LOCAL)
Expand Down Expand Up @@ -237,6 +242,8 @@ def log_out_npo():
if bool(profile.json) and expires > time.time():
return True

log_out_npo()

# Fetch a CSRF token
data = UriHandler.open("https://npo.nl/start/api/auth/csrf", no_cache=True)
csrf_token = JsonHelper(data).get_value("csrfToken")
Expand Down

0 comments on commit a918a1f

Please sign in to comment.