diff --git a/gateway/src/api/routes/notifications.py b/gateway/src/api/routes/notifications.py index 09d07ee..d2ddd81 100644 --- a/gateway/src/api/routes/notifications.py +++ b/gateway/src/api/routes/notifications.py @@ -29,7 +29,7 @@ async def get_chat_by_user_id( user_id: int, authorization: Annotated[str | None, Header()] = None, ): - await checkAuth(req, authorization) + await checkAuth(req, authorization, userId=user_id) query = {} query["user_id"] = user_id request_id = req.state.request_id diff --git a/gateway/src/api/routes/subscriptions.py b/gateway/src/api/routes/subscriptions.py index f5142cc..07b2a10 100644 --- a/gateway/src/api/routes/subscriptions.py +++ b/gateway/src/api/routes/subscriptions.py @@ -4,7 +4,7 @@ from asyncreq import request from fastapi import APIRouter, Header, HTTPException, Request from src.api.config import API_SUBSCRIPTIONS -from src.api.routes.auth import status as checkAuth +from src.api.routes.auth import checkAuth from src.api.schemas.subscriptions import Subscription router = APIRouter() @@ -16,7 +16,7 @@ async def create_subscription( req: Request, authorization: Annotated[str | None, Header()] = None, ): - await checkAuth(req, authorization) + await checkAuth(req, authorization, userId=subscription.user_id) request_id = req.state.request_id header = {"x-api-request-id": request_id} (response, status, _) = await request( @@ -33,7 +33,7 @@ async def delete_subscription( req: Request, authorization: Annotated[str | None, Header()] = None, ): - await checkAuth(req, authorization) + await checkAuth(req, authorization, userId=subscription.user_id) request_id = req.state.request_id header = {"x-api-request-id": request_id} (response, status, _) = await request( @@ -51,7 +51,7 @@ async def get_subscriptions( flight_id: Optional[int] = None, authorization: Annotated[str | None, Header()] = None, ): - await checkAuth(req, authorization) + await checkAuth(req, authorization, userId=user_id) query = {} query["user_id"] = user_id if flight_id: