frontend-app-api: route sign-in errors through app boundary

Rethrow sign-in bootstrap failures from inside the prepared sign-in tree so the app root extension boundary handles them instead of createApp keeping its own error state. This keeps bootstrap error handling aligned with the rest of the extension tree.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
This commit is contained in:
Patrik Oldsberg
2026-03-12 22:13:45 +01:00
parent f4c03772a4
commit 72dd26a3a6
3 changed files with 98 additions and 21 deletions
+17 -14
View File
@@ -22,6 +22,7 @@ import {
JSX,
} from 'react';
import {
ExtensionBoundary,
coreExtensionData,
discoveryApiRef,
fetchApiRef,
@@ -84,7 +85,7 @@ export const AppRoot = createExtension({
),
},
output: [coreExtensionData.reactElement],
factory({ inputs, apis }) {
factory({ inputs, apis, node }) {
if (isProtectedApp()) {
const identityApi = apis.get(identityApiRef);
if (!identityApi) {
@@ -123,19 +124,21 @@ export const AppRoot = createExtension({
return [
coreExtensionData.reactElement(
<AppRouter
SignInPageComponent={inputs.signInPage?.get(
SignInPageBlueprint.dataRefs.component,
)}
RouterComponent={inputs.router?.get(
RouterBlueprint.dataRefs.component,
)}
extraElements={inputs.elements?.map(el =>
el.get(coreExtensionData.reactElement),
)}
>
{content}
</AppRouter>,
<ExtensionBoundary node={node}>
<AppRouter
SignInPageComponent={inputs.signInPage?.get(
SignInPageBlueprint.dataRefs.component,
)}
RouterComponent={inputs.router?.get(
RouterBlueprint.dataRefs.component,
)}
extraElements={inputs.elements?.map(el =>
el.get(coreExtensionData.reactElement),
)}
>
{content}
</AppRouter>
</ExtensionBoundary>,
),
];
},