diff --git a/maubot/management/api/log.py b/maubot/management/api/log.py index bead189..fee233f 100644 --- a/maubot/management/api/log.py +++ b/maubot/management/api/log.py @@ -133,7 +133,8 @@ async def log_websocket(request: web.Request) -> web.WebSocketResponse: await ws.close() except Exception: pass - handler.listeners.remove(ws) + if authenticated: + handler.listeners.remove(ws) log.debug(f"Connection from {request.remote} closed") sockets.remove(ws) return ws