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

Merged
jason.woltje merged 1 commits from fix/websocket-reconnect into main 2026-02-27 11:30:45 +00:00
Owner

Summary

Fixes the persistent Reconnecting

## Summary Fixes the persistent Reconnecting
jason.woltje added 1 commit 2026-02-27 11:30:24 +00:00
fix(web,api): fix WebSocket authentication for chat real-time connection
Some checks failed
ci/woodpecker/push/web Pipeline failed
ci/woodpecker/push/api Pipeline was successful
c15456a779
- Add withCredentials: true to socket.io client so session cookies are
  sent cross-origin with the WebSocket upgrade request
- Add cookie extraction in gateway extractTokenFromHandshake() as a
  fallback after auth.token, parsing all three BetterAuth session cookie
  name variants (__Secure-, bare, __Host- prefixes)
- Fix Chat.tsx useWebSocket call: use actual workspace ID from auth
  context (currentWorkspaceId ?? workspaceId) instead of user.id

Closes #534

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jason.woltje merged commit c0e679ab7c into main 2026-02-27 11:30:45 +00:00
Sign in to join this conversation.