Cors and token (#5850)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2025-11-24 00:58:54 +01:00
committed by GitHub
parent 8f9f6391ba
commit e566f1ed65
2 changed files with 52 additions and 23 deletions
+3 -2
View File
@@ -138,7 +138,8 @@ function removeThinkingIndicator() {
// Connect to WebSocket
function connectWebSocket() {
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsUrl = `${protocol}//${window.location.host}/ws`;
const token = window.GOOSE_WS_TOKEN || '';
const wsUrl = `${protocol}//${window.location.host}/ws?token=${encodeURIComponent(token)}`;
socket = new WebSocket(wsUrl);
@@ -520,4 +521,4 @@ function updateSessionTitle() {
}
// Update title on load
updateSessionTitle();
updateSessionTitle();