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:
+2
-2
@@ -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';
|
||||||
|
|||||||
Reference in New Issue
Block a user