Lendemor 4 miesięcy temu
rodzic
commit
2f215a350e
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      reflex/app.py

+ 2 - 2
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: