Skip to content

Commit 5ac0b2b

Browse files
committed
refactor: simplify cache timeout handling in user token management
1 parent 6068530 commit 5ac0b2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/common/auth/handle/impl/user_token.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def handle(self, request, token: str, get_token_details):
304304
raise AppAuthenticationFailed(1002, _('Login expired'))
305305
auth_details = get_token_details()
306306
timeout = CONFIG.get_session_timeout()
307-
cache.touch(token, timeout=datetime.timedelta(seconds=timeout).seconds, version=version)
307+
cache.touch(token, timeout=timeout, version=version)
308308
user = QuerySet(User).get(id=auth_details['id'])
309309
auth = get_auth(user)
310310
return user, auth

0 commit comments

Comments
 (0)