Fix auth token localStorage key consistency
- Dashboard, viewer, and native viewer all now use guruconnect_token - Fixed loadMachines() to include Authorization header
This commit is contained in:
@@ -175,7 +175,7 @@
|
||||
}
|
||||
|
||||
// Get viewer name from localStorage (same as dashboard)
|
||||
const user = JSON.parse(localStorage.getItem('user') || 'null');
|
||||
const user = JSON.parse(localStorage.getItem('guruconnect_user') || 'null');
|
||||
const viewerName = user?.name || user?.email || 'Technician';
|
||||
|
||||
// State
|
||||
@@ -597,7 +597,7 @@
|
||||
|
||||
function connect() {
|
||||
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||
const token = localStorage.getItem('authToken');
|
||||
const token = localStorage.getItem('guruconnect_token');
|
||||
if (!token) {
|
||||
updateStatus('error', 'Not authenticated');
|
||||
document.getElementById('overlay-text').textContent = 'Not logged in. Please log in first.';
|
||||
|
||||
Reference in New Issue
Block a user