diff --git a/backend/apps/socket/main.py b/backend/apps/socket/main.py index bbbbccd79..123ff31cd 100644 --- a/backend/apps/socket/main.py +++ b/backend/apps/socket/main.py @@ -24,9 +24,7 @@ async def connect(sid, environ, auth): data = decode_token(auth["token"]) if data is not None and "id" in data: - from apps.webui.internal.db import SessionLocal - - user = Users.get_user_by_id(SessionLocal(), data["id"]) + user = Users.get_user_by_id(data["id"]) if user: SESSION_POOL[sid] = user.id diff --git a/backend/main.py b/backend/main.py index 8892d9bc7..2c4d5ecfd 100644 --- a/backend/main.py +++ b/backend/main.py @@ -751,7 +751,6 @@ class PipelineMiddleware(BaseHTTPMiddleware): user = get_current_user( request, get_http_authorization_cred(request.headers.get("Authorization")), - SessionLocal(), ) try: