diff --git a/services/auth.py b/services/auth.py index 305edfe..a0bdde9 100644 --- a/services/auth.py +++ b/services/auth.py @@ -3,6 +3,7 @@ from functools import wraps import aiohttp from aiohttp.web import HTTPUnauthorized +from models.member import ChatMember from services.core import get_author from settings import AUTH_URL @@ -65,7 +66,9 @@ def login_required(f): raise HTTPUnauthorized(text="Please, login first") else: # Добавляем author_id и user_id в контекст - context["author_id"] = await get_author(user_id) + author: ChatMember | None = await get_author(user_id) + if author: + context["author_id"] = author["id"] context["user_id"] = user_id # Если пользователь аутентифицирован, выполняем резолвер