Skip to content

Commit

Permalink
Fix: Session expired (All-Hands-AI#5305)
Browse files Browse the repository at this point in the history
  • Loading branch information
tofarr authored Nov 29, 2024
1 parent ea994b6 commit 16a7dd5
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions openhands/server/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from openhands.events.observation import (
NullObservation,
)
from openhands.events.observation.error import ErrorObservation
from openhands.events.serialization import event_to_dict
from openhands.events.stream import AsyncEventStreamWrapper
from openhands.server.auth import get_sid_from_token, sign_token
Expand Down Expand Up @@ -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})
return
logger.info(f'Existing session: {sid}')
else:
Expand Down

0 comments on commit 16a7dd5

Please sign in to comment.