From f3215e16f90905687ece5b0505a1f32b0d5df88a Mon Sep 17 00:00:00 2001 From: Igor Ilic Date: Thu, 8 Jan 2026 12:51:11 +0100 Subject: [PATCH] refactor: Remove silent handling of lifetime assignment --- cognee/modules/users/authentication/get_api_auth_backend.py | 5 +---- .../modules/users/authentication/get_client_auth_backend.py | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) 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)