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.
This commit is contained in:
Bohdan Triapitsyn
2026-07-05 02:01:02 +03:00
parent 01ca2ecf24
commit aecf7af892
+10 -1
View File
@@ -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 = <MobileApp apis={resolvedApis} />;
createRoot(rootElement).render(
<StrictMode>
<I18nProvider>
<ThemeSystemProvider>
<ThemeProvider>
<DiffWorkerProvider>
<MobileApp apis={resolvedApis} />
{isNativeShell ? app : <SessionAuthGate>{app}</SessionAuthGate>}
</DiffWorkerProvider>
</ThemeProvider>
</ThemeSystemProvider>