From cd6cbd99482f52c01a351a9a51d8b083afd2a373 Mon Sep 17 00:00:00 2001 From: Thomas Wade Date: Wed, 22 Apr 2020 17:33:39 +0930 Subject: [PATCH] Log in properly and clear cookies on failure Just because we say we're logged in doesn't mean we actually are logged in. --- FAAPI/FAAPI.py | 5 +---- setup.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/FAAPI/FAAPI.py b/FAAPI/FAAPI.py index 673582b..1657dc6 100644 --- a/FAAPI/FAAPI.py +++ b/FAAPI/FAAPI.py @@ -467,10 +467,6 @@ class FAAPI: :param cookies: Cookies to use for this session. :return: Whether the login attempt was successful. """ - if self.logged_in: - # No need to do anything if we're already logged in - return True - if cookies: self._cookies = cookies elif not self._cookies: @@ -496,6 +492,7 @@ class FAAPI: except IndexError: # Not logged in self.logged_in = False + self._cookies = None return False # Mark this instance as logged in diff --git a/setup.py b/setup.py index 5157b4d..ff99c5b 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name='FAAPI', - version='0.5.3', + version='0.5.4', packages=find_packages(), url='https://tem.party/gitea/tom/FAAPI', license='WTFPL',