fix(web,api): fix WebSocket authentication for chat real-time connection (#547)
Co-authored-by: Jason Woltje <jason@diversecanvas.com> Co-committed-by: Jason Woltje <jason@diversecanvas.com>
This commit was merged in pull request #547.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user