diff --git a/cognee/modules/users/authentication/get_api_auth_backend.py b/cognee/modules/users/authentication/get_api_auth_backend.py index 799d118f9..6d39c7d8f 100644 --- a/cognee/modules/users/authentication/get_api_auth_backend.py +++ b/cognee/modules/users/authentication/get_api_auth_backend.py @@ -16,10 +16,7 @@ def get_api_auth_backend(): def get_jwt_strategy() -> JWTStrategy[models.UP, models.ID]: secret = os.getenv("FASTAPI_USERS_JWT_SECRET", "super_secret") - try: - lifetime_seconds = int(os.getenv("JWT_LIFETIME_SECONDS", "3600")) - except ValueError: - lifetime_seconds = 3600 + lifetime_seconds = int(os.getenv("JWT_LIFETIME_SECONDS", "3600")) return APIJWTStrategy(secret, lifetime_seconds=lifetime_seconds) diff --git a/cognee/modules/users/authentication/get_client_auth_backend.py b/cognee/modules/users/authentication/get_client_auth_backend.py index bf794377d..ba5dad2b3 100644 --- a/cognee/modules/users/authentication/get_client_auth_backend.py +++ b/cognee/modules/users/authentication/get_client_auth_backend.py @@ -18,10 +18,7 @@ def get_client_auth_backend(): from .default.default_jwt_strategy import DefaultJWTStrategy secret = os.getenv("FASTAPI_USERS_JWT_SECRET", "super_secret") - try: - lifetime_seconds = int(os.getenv("JWT_LIFETIME_SECONDS", "3600")) - except ValueError: - lifetime_seconds = 3600 + lifetime_seconds = int(os.getenv("JWT_LIFETIME_SECONDS", "3600")) return DefaultJWTStrategy(secret, lifetime_seconds=lifetime_seconds)