diff --git a/services/auth.py b/services/auth.py index c0e3222..d76d71e 100644 --- a/services/auth.py +++ b/services/auth.py @@ -2,7 +2,7 @@ from functools import wraps from aiohttp import ClientSession from starlette.exceptions import HTTPException -from services.core import get_all_authors +from services.core import get_all_authors, cached_authors from settings import AUTH_URL @@ -60,7 +60,7 @@ def login_required(f): user_id = await check_auth(req) if user_id: context["user_id"] = user_id - authors_by_user, authors_by_id = get_all_authors() + authors_by_user, authors_by_id = cached_authors author = authors_by_user.get(user_id) if author and "id" in author: context["author_id"] = author["id"]