From 95bfbfc04bb4a6bfe9349236189f99e44ae71e5d Mon Sep 17 00:00:00 2001 From: Jakob Date: Mon, 2 Dec 2019 23:17:06 -0600 Subject: [PATCH] Clear credentials on failed login --- auth.py | 2 ++ common.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/auth.py b/auth.py index e20a81a..74ebd31 100644 --- a/auth.py +++ b/auth.py @@ -310,6 +310,8 @@ class CookieAuthHandler(urllib.request.HTTPCookieProcessor): if resp.url.endswith('/webapps/login'): log('error', "Login failed. Are your credentials correct?") + del self.storage_mgr['username'] + del self.stoarge_mgr['password'] else: self.storage_mgr['username'] = username self.storage_mgr['password'] = encode(password) diff --git a/common.py b/common.py index b6346a6..e3830c2 100644 --- a/common.py +++ b/common.py @@ -78,3 +78,7 @@ class StorageManager(): def __setitem__(self, key, value): self.patch[key] = value + + def __delitem__(self, key): + self.patch.pop(key, None) + self.cache.pop(key, None) -- 2.30.2