diff --git a/utils/auth.py b/utils/auth.py index e806f87..c104b0e 100644 --- a/utils/auth.py +++ b/utils/auth.py @@ -35,28 +35,13 @@ def login( """ import time - # Read default configuration from environment variables - username = username or os.getenv("ERP_USERNAME") - password = password or os.getenv("ERP_PASSWORD") - - # URL handling: read from environment variable or parameter + # Validate required parameters + if not username: + raise ValueError("username is required") + if not password: + raise ValueError("password is required") if not url: - url = os.getenv("ERP_URL") - if url and not url.endswith("login/main/index.html"): - url = url.rstrip("/") + "/yonbip/resources/uap/rbac/login/main/index.html" - - if not url: - raise ValueError("URL must be provided either as parameter or through ERP_URL environment variable") - - # headless parameter handling - if headless is None: - headless_str = os.getenv("ERP_HEADLESS", "false").lower() - headless = headless_str in ("true", "1", "yes") - - # ignore_https_errors parameter handling - if ignore_https_errors is None: - ignore_https_errors_str = os.getenv("ERP_IGNORE_HTTPS_ERRORS", "true").lower() - ignore_https_errors = ignore_https_errors_str in ("true", "1", "yes") + raise ValueError("url is required") # Launch browser browser = playwright.chromium.launch(headless=headless)