fix(web,api): fix WebSocket authentication for chat real-time connection (#547)

Co-authored-by: Jason Woltje <[email protected]>
Co-committed-by: Jason Woltje <[email protected]>
This commit is contained in:
2026-02-27 11:30:44 +00:00
committed by jason.woltje
parent 6ac63fe755
commit c0e679ab7c
3 changed files with 68 additions and 3 deletions
+3
View File
@@ -97,9 +97,12 @@ export function useWebSocket(
setConnectionError(null);
// Create socket connection
// withCredentials sends session cookies cross-origin so the gateway can
// authenticate via cookie when no explicit token is provided.
const newSocket = io(wsUrl, {
auth: { token },
query: { workspaceId },
withCredentials: true,
});
setSocket(newSocket);