From aecf7af892507129f30bc38535a1733cb659314d Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Sun, 5 Jul 2026 02:01:02 +0300 Subject: [PATCH] fix(mobile): restore the password unlock page in mobile browsers The native-apps change removed SessionAuthGate from the whole mobile render path, but that path also serves the plain mobile browser: against a --ui-password server it never authenticated and dead-ended on the unreachable-server screen with no way to enter the password. The gate is back for the browser shell; the Capacitor app keeps its own instance-connect flow ungated. --- packages/ui/src/apps/renderMobileApp.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/apps/renderMobileApp.tsx b/packages/ui/src/apps/renderMobileApp.tsx index 3c2beeaf..e20e187b 100644 --- a/packages/ui/src/apps/renderMobileApp.tsx +++ b/packages/ui/src/apps/renderMobileApp.tsx @@ -17,6 +17,7 @@ import { initializeAppearancePreferences, syncDesktopSettings } from '@/lib/pers import { startModelPrefsAutoSave } from '@/lib/modelPrefsAutoSave'; import { startTypographyWatcher } from '@/lib/typographyWatcher'; import { preloadMarkdownRenderer } from '@/components/chat/markdownRendererLoader'; +import { SessionAuthGate } from '@/components/auth/SessionAuthGate'; import { MobileApp } from './MobileApp'; const initializeSharedPreferences = () => { @@ -72,13 +73,21 @@ export function renderMobileApp(apis: RuntimeAPIs) { ? { ...apis, notifications: { notifyAgentCompletion: async () => false, canNotify: () => false } } : apis; + // Auth gating differs by shell: the native Capacitor app authenticates via + // its own instance-connect flow (MobileConnectionWelcome asks for the + // password per instance), while the plain mobile BROWSER against a + // --ui-password server must get the classic SessionAuthGate unlock page — + // dropping it (v1.13.9) left browsers on a dead "unable to reach server" + // screen with no way to enter the password. + const app = ; + createRoot(rootElement).render( - + {isNativeShell ? app : {app}}