diff --git a/public/app.js b/public/app.js index 0dae8ed..62c4f75 100644 --- a/public/app.js +++ b/public/app.js @@ -35,6 +35,9 @@ async function submitAuthToken() { localStorage.setItem('nexus_token', val); hideAuthGate(); toast('Authenticated', 'success'); + _wsHalted = false; + _wsBackoff = 1000; + _wsAttempts = 0; bootApp(); } else { document.getElementById('authError').style.display = 'block'; @@ -47,7 +50,8 @@ async function submitAuthToken() { async function probeAuth() { try { - const r = await _origFetch('/api/status'); + const opts = nexusToken ? { headers: { 'Authorization': 'Bearer ' + nexusToken } } : {}; + const r = await _origFetch('/api/status', opts); if (r.status === 401) { showAuthGate(); return false; } return true; } catch(e) { return true; } @@ -79,7 +83,6 @@ let publicUrl = null; let telemetryChart = null; document.addEventListener('DOMContentLoaded', () => { - initWebSocket(); initChart(); updateServerEndpoint(); });