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:
@@ -17,6 +17,7 @@ import { initializeAppearancePreferences, syncDesktopSettings } from '@/lib/pers
|
|||||||
import { startModelPrefsAutoSave } from '@/lib/modelPrefsAutoSave';
|
import { startModelPrefsAutoSave } from '@/lib/modelPrefsAutoSave';
|
||||||
import { startTypographyWatcher } from '@/lib/typographyWatcher';
|
import { startTypographyWatcher } from '@/lib/typographyWatcher';
|
||||||
import { preloadMarkdownRenderer } from '@/components/chat/markdownRendererLoader';
|
import { preloadMarkdownRenderer } from '@/components/chat/markdownRendererLoader';
|
||||||
|
import { SessionAuthGate } from '@/components/auth/SessionAuthGate';
|
||||||
import { MobileApp } from './MobileApp';
|
import { MobileApp } from './MobileApp';
|
||||||
|
|
||||||
const initializeSharedPreferences = () => {
|
const initializeSharedPreferences = () => {
|
||||||
@@ -72,13 +73,21 @@ export function renderMobileApp(apis: RuntimeAPIs) {
|
|||||||
? { ...apis, notifications: { notifyAgentCompletion: async () => false, canNotify: () => false } }
|
? { ...apis, notifications: { notifyAgentCompletion: async () => false, canNotify: () => false } }
|
||||||
: apis;
|
: 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(
|
createRoot(rootElement).render(
|
||||||
<StrictMode>
|
<StrictMode>
|
||||||
<I18nProvider>
|
<I18nProvider>
|
||||||
<ThemeSystemProvider>
|
<ThemeSystemProvider>
|
||||||
<ThemeProvider>
|
<ThemeProvider>
|
||||||
<DiffWorkerProvider>
|
<DiffWorkerProvider>
|
||||||
<MobileApp apis={resolvedApis} />
|
{isNativeShell ? app : <SessionAuthGate>{app}</SessionAuthGate>}
|
||||||
</DiffWorkerProvider>
|
</DiffWorkerProvider>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</ThemeSystemProvider>
|
</ThemeSystemProvider>
|
||||||
|
|||||||
Reference in New Issue
Block a user