fix: Token auth (#3543)

This commit is contained in:
shaohuzhang1 2025-07-10 12:07:33 +08:00 committed by GitHub
parent 4f31977d7d
commit 9d2fd05604
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -303,5 +303,7 @@ class UserToken(AuthBaseHandle):
timeout = CONFIG.get_session_timeout()
cache.touch(token, timeout=timeout, version=version)
user = QuerySet(User).get(id=auth_details['id'])
if not user.is_active or user.password != cache_token.password:
raise AppAuthenticationFailed(1002, _('Authentication information is incorrect'))
auth = get_auth(user)
return user, auth