From 5ac0b2be3d7adf9d209079ed60ff1c862ef199b1 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Wed, 2 Jul 2025 12:43:50 +0800 Subject: [PATCH] refactor: simplify cache timeout handling in user token management --- apps/common/auth/handle/impl/user_token.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/common/auth/handle/impl/user_token.py b/apps/common/auth/handle/impl/user_token.py index 6a65e46e8..217761236 100644 --- a/apps/common/auth/handle/impl/user_token.py +++ b/apps/common/auth/handle/impl/user_token.py @@ -304,7 +304,7 @@ class UserToken(AuthBaseHandle): raise AppAuthenticationFailed(1002, _('Login expired')) auth_details = get_token_details() timeout = CONFIG.get_session_timeout() - cache.touch(token, timeout=datetime.timedelta(seconds=timeout).seconds, version=version) + cache.touch(token, timeout=timeout, version=version) user = QuerySet(User).get(id=auth_details['id']) auth = get_auth(user) return user, auth