fix: remove debug code that bypassed authentication in Docker builds (addresses #428)

Debug code was accidentally left in v4.15.0-rc.3 that skipped authentication
entirely, preventing the login screen from appearing. This affected Docker
deployments where authentication was expected.

- Removed early return that bypassed auth checks
- Restored proper isLoading initial state
- Removed WebSocket early initialization
- Cleaned up debug console.log statements
This commit is contained in:
Pulse Monitor
2025-09-11 07:12:24 +00:00
parent 401168cf5c
commit d9a6859fbd
+5 -21
View File
@@ -46,16 +46,14 @@ export const useDarkMode = () => {
};
function App() {
console.log('[App] Component initializing...');
// Simple auth state - START WITH FALSE TO BYPASS LOADING
const [isLoading, setIsLoading] = createSignal(false);
// Simple auth state
const [isLoading, setIsLoading] = createSignal(true);
const [needsAuth, setNeedsAuth] = createSignal(false);
const [hasAuth, setHasAuth] = createSignal(false);
const [proxyAuthInfo, setProxyAuthInfo] = createSignal<{ username?: string; logoutURL?: string } | null>(null);
// Initialize WebSocket immediately for testing
const [wsStore, setWsStore] = createSignal<EnhancedStore | null>(getGlobalWebSocketStore());
// Don't initialize WebSocket until after auth check
const [wsStore, setWsStore] = createSignal<EnhancedStore | null>(null);
const state = () => wsStore()?.state || { vms: [], containers: [], nodes: [], pbs: [], lastUpdate: '' };
const connected = () => wsStore()?.connected() || false;
const reconnecting = () => wsStore()?.reconnecting() || false;
@@ -166,16 +164,7 @@ function App() {
// Check auth on mount
onMount(async () => {
console.log('[App] onMount triggered, starting auth check...');
console.log('[App] Current location:', window.location.href);
// Add a timeout fallback - if auth check takes too long, just proceed
const timeoutId = setTimeout(() => {
console.error('[App] Auth check timeout - proceeding without auth');
setIsLoading(false);
setNeedsAuth(false);
setWsStore(getGlobalWebSocketStore());
}, 10000); // 10 second timeout
console.log('[App] Starting auth check...');
// Check if we just logged out - if so, always show login page
const justLoggedOut = localStorage.getItem('just_logged_out');
@@ -190,11 +179,8 @@ function App() {
// First check security status to see if auth is configured
try {
console.log('[App] Fetching /api/security/status...');
const securityRes = await apiFetch('/api/security/status');
console.log('[App] Security response received:', securityRes.status);
const securityData = await securityRes.json();
console.log('[App] Security data:', securityData);
console.log('[App] Security status:', securityData);
// Check if auth is disabled via DISABLE_AUTH
@@ -342,7 +328,6 @@ function App() {
// Theme is already applied on initialization, no need to reapply
} finally {
clearTimeout(timeoutId); // Clear the timeout since we completed
setIsLoading(false);
}
@@ -411,7 +396,6 @@ function App() {
const enhancedStore = () => wsStore();
// Use Show for reactive rendering
console.log('[App] Rendering, isLoading:', isLoading());
return (
<Show
when={!isLoading()}