fix comand
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user