diff --git a/backend/open_webui/utils/auth.py b/backend/open_webui/utils/auth.py index 3f05256c70..23fe517150 100644 --- a/backend/open_webui/utils/auth.py +++ b/backend/open_webui/utils/auth.py @@ -235,7 +235,7 @@ async def invalidate_token(request, token): jti = decoded.get("jti") exp = decoded.get("exp") - if jti: + if jti and exp: ttl = exp - int( datetime.now(UTC).timestamp() ) # Calculate time-to-live for the token