feat: add is_logged method

This commit is contained in:
2025-12-14 17:34:58 +01:00
parent 8b406f5d4e
commit 8090a3432c

View File

@@ -5,12 +5,12 @@ from skywipe.configure import Configuration
class Auth: class Auth:
def __init__(self, configuration: Configuration = None): def __init__(self):
self.configuration = configuration or Configuration() self.config = Configuration()
self.client: Client = None self.client = None
def login(self) -> Client: def login(self) -> Client:
config_data = self.configuration.load() config_data = self.config.load()
handle = config_data.get("handle") handle = config_data.get("handle")
password = config_data.get("password") password = config_data.get("password")
@@ -23,3 +23,6 @@ class Auth:
self.client.login(handle, password) self.client.login(handle, password)
return self.client return self.client
def is_logged(self) -> bool:
return bool(getattr(self.client, "me", None))