fix(dashboard): Fix JavaScript syntax errors in token handling

- Fixed Authorization header: '***' -> 'Bearer ' + token
- Fixed WebSocket URL: *** ->
- Dashboard should now load data correctly
This commit is contained in:
Bernt (LandveX AI)
2026-07-12 18:06:37 +00:00
parent 37a1af4a1f
commit 7f73e8f03f
+2 -2
View File
@@ -416,7 +416,7 @@
try { try {
const token = getToken(); const token = getToken();
const res = await fetch('/api/v1/analytics/dashboard', { const res = await fetch('/api/v1/analytics/dashboard', {
headers: { 'Authorization': '***' + token } headers: { 'Authorization': 'Bearer ' + token }
}); });
const data = await res.json(); const data = await res.json();
@@ -531,7 +531,7 @@
function connectWebSocket() { function connectWebSocket() {
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const token = getToken(); const token = getToken();
ws = new WebSocket(`${protocol}//${window.location.host}/ws?tenant_id=default&token=***`); ws = new WebSocket(`${protocol}//${window.location.host}/ws?tenant_id=default&token=${token}`);
ws.onopen = () => { ws.onopen = () => {
document.getElementById('live-indicator').style.display = 'inline-flex'; document.getElementById('live-indicator').style.display = 'inline-flex';