add iaai auto-login with session persistence

This commit is contained in:
qananasikq
2026-04-10 19:59:03 +03:00
parent 05b83b5518
commit 6134b10fd0
4 changed files with 117 additions and 1 deletions

View File

@@ -174,11 +174,18 @@ class SessionConfig:
storage_state_path: str | None = _env_optional_str("IAAI_STORAGE_STATE_PATH")
max_age_days: int = _env_int("IAAI_SESSION_MAX_AGE_DAYS", 30)
save_on_exit: bool = _env_bool("IAAI_SESSION_SAVE_ON_EXIT", True)
login_email: str | None = _env_optional_str("IAAI_LOGIN_EMAIL")
login_password: str | None = _env_optional_str("IAAI_LOGIN_PASSWORD")
login_url: str = _env_str("IAAI_LOGIN_URL", "https://www.iaai.com/Login")
@property
def enabled(self) -> bool:
return bool(self.storage_state_path)
@property
def has_credentials(self) -> bool:
return bool(self.login_email and self.login_password)
# --- Главный объект настроек: собирает все блоки конфигурации ---