Fix ping on credential restoration

This commit is contained in:
2025-09-24 20:14:47 +03:00
Unverified
parent f98b91ea3c
commit 7e09cd2c7c
2 changed files with 37 additions and 6 deletions
+21 -1
View File
@@ -242,8 +242,28 @@ class MessaggingSocketManager:
current_user = get_current_user_inner()
if current_user:
self.user_by_ws[websocket] = current_user.id
else:
await websocket.send_json({
"type": "ping",
"data": {
"status": "error",
"error": {
"detail": "Failed to authorize",
"code": 401
}
}
})
except HTTPException:
pass
await websocket.send_json({
"type": "ping",
"data": {
"status": "error",
"error": {
"detail": "Failed to authorize",
"code": 401
}
}
})
await websocket.send_json({"type": "ping", "data": {"status": "success"}})
elif type == "getMessages":
try: