Cors and token (#5850)
Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user