fix comand

This commit is contained in:
Yuriy Yuriev
2026-05-22 23:06:31 +07:00
parent 22b49109fa
commit e2e2761b51
2 changed files with 14 additions and 7 deletions
+4
View File
@@ -37,6 +37,10 @@ class AuthManager:
def is_authenticated(self, user_id: int) -> bool:
if user_id not in self._sessions:
return False
# Обычные пользователи — сессия бесконечная
if self._roles.get(user_id) != "admin":
return True
# Админы — таймаут применяется
if datetime.now() - self._sessions[user_id] > self._session_timeout:
self.logout(user_id)
return False