mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 09:43:10 +00:00
refactor: simplify cache timeout handling in user token management
This commit is contained in:
parent
6068530cdd
commit
5ac0b2be3d
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue