diff --git a/bff/ws_proxy.py b/bff/ws_proxy.py index a245f79..c71188d 100644 --- a/bff/ws_proxy.py +++ b/bff/ws_proxy.py @@ -3,6 +3,7 @@ import asyncio import json import logging +import secrets from fastapi import APIRouter, WebSocket, WebSocketDisconnect import websockets @@ -32,10 +33,11 @@ async def ws_proxy(ws: WebSocket, token: str = ""): try: async with websockets.connect(TRACKER_WS_URL) as tracker_ws: - # Send auth to tracker on behalf of user + # Auth to tracker with on_behalf_of so Tracker uses user's slug auth_msg = json.dumps({ "type": "auth", "token": TRACKER_TOKEN, + "on_behalf_of": user_slug, }) await tracker_ws.send(auth_msg)