app/api/__init__.py
@@ -48,11 +48,10 @@ async def get_current_user_websocket(websocket: WebSocket): auth_header = websocket.headers.get('Authorization') if auth_header is None or not auth_header.startswith('Bearer '): token = websocket.query_params.get('token') if token is None: await websocket.close(code=1008) raise WebSocketDisconnect(code=status.WS_1008_POLICY_VIOLATION) token = auth_header[len('Bearer '):] try: payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM]) username: str = payload.get("sub")