π OpenHands: AI-Driven Development
Fix: Session expired (#5305)
tofarr16a7dd52aead
diff --git a/openhands/server/socket.py b/openhands/server/socket.pyindex 35549548db..19a4993a29 100644--- a/openhands/server/socket.py+++ b/openhands/server/socket.py@@ -8,7 +8,6 @@ from openhands.events.action import (from openhands.events.observation import (NullObservation,)-from openhands.events.observation.error import ErrorObservationfrom openhands.events.serialization import event_to_dictfrom openhands.events.stream import AsyncEventStreamWrapperfrom openhands.server.auth import get_sid_from_token, sign_token@@ -42,14 +41,7 @@ async def init_connection(connection_id: str, data: dict):if token:sid = get_sid_from_token(token, config.jwt_secret)if sid == '':- await sio.emit(- 'oh_event',- event_to_dict(- ErrorObservation(- content='Invalid token! Please ensure a valid jwt_secret is specified or use -e JWT_TOKEN when running with Docker.'- )- ),- )+ await sio.emit('oh_event', {'error': 'Invalid token', 'error_code': 401})returnlogger.info(f'Existing session: {sid}')else: