From e2f1f04d3589dfacd076d09c9da7bc2616124ee8 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 3 Aug 2026 14:27:12 +0000 Subject: [PATCH] fix: single WS boot path, probe sends stored token, un-halt on auth success --- public/app.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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(); });