From 2f215a350e6e3ca544b8f9d158d6b09605a4d993 Mon Sep 17 00:00:00 2001 From: Lendemor Date: Thu, 9 Jan 2025 16:21:35 +0100 Subject: [PATCH] fix issue --- reflex/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reflex/app.py b/reflex/app.py index d5d74e362..7c1725988 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -1538,7 +1538,7 @@ class EventNamespace(AsyncNamespace): environ: The request information, including HTTP headers. """ query_params = urllib.parse.parse_qs(environ.get("QUERY_STRING")) - await self.link_token_to_sid(sid, query_params.get("token")) + await self.link_token_to_sid(sid, query_params.get("token", [])[0]) def on_disconnect(self, sid): """Event for when the websocket disconnects. @@ -1611,7 +1611,7 @@ class EventNamespace(AsyncNamespace): # Emit the test event. await self.emit(str(constants.SocketEvent.PING), "pong", to=sid) - async def link_token_to_sid(self, sid, token): + async def link_token_to_sid(self, sid: str, token: str): """Link a token to a session id. Args: