From effb7269795087384376ebb399e06b5f9a018025 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 16 Jun 2026 00:15:18 +0000 Subject: [PATCH] fix: add 10-second timeout to Authelia fetch to prevent white screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without a timeout, session.defaultSession.fetch() hangs for 1-2 minutes on TCP timeout when Authelia is unreachable (wrong URL, server down, firewall). Since createWindow() awaits autheliaAuthenticate(), the main window is visible but no BrowserView is attached during that wait — causing a persistent white screen with ibeam cursor. https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU --- ubuntu-based-kiosk-v1.0.2.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ubuntu-based-kiosk-v1.0.2.sh b/ubuntu-based-kiosk-v1.0.2.sh index 32ad4af..a251d8d 100644 --- a/ubuntu-based-kiosk-v1.0.2.sh +++ b/ubuntu-based-kiosk-v1.0.2.sh @@ -5309,11 +5309,14 @@ async function autheliaAuthenticate(){ const decipher=crypto.createDecipheriv('aes-256-cbc',key,iv); const password=Buffer.concat([decipher.update(enc),decipher.final()]).toString('utf8'); + const ctrl=new AbortController(); + const timer=setTimeout(()=>ctrl.abort(),10000); const res=await session.defaultSession.fetch(`${autheliaURL}/api/firstfactor`,{ method:'POST', headers:{'Content-Type':'application/json','User-Agent':'kiosk/1.0'}, - body:JSON.stringify({username:autheliaUsername,password,keepMeLoggedIn:true,requestMethod:'GET',targetURL:''}) - }); + body:JSON.stringify({username:autheliaUsername,password,keepMeLoggedIn:true,requestMethod:'GET',targetURL:''}), + signal:ctrl.signal + }).finally(()=>clearTimeout(timer)); const body=await res.json().catch(()=>({})); if(res.ok&&body.status==='OK'){ console.log('[AUTHELIA] Authenticated as',autheliaUsername);