frontend-defaults: add createPublicSignInApp
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
"@backstage/core-components": "workspace:^",
|
||||
"@backstage/core-plugin-api": "workspace:^",
|
||||
"@backstage/frontend-app-api": "workspace:^",
|
||||
"@backstage/frontend-defaults": "workspace:^",
|
||||
"@backstage/frontend-plugin-api": "workspace:^",
|
||||
"@backstage/integration-react": "workspace:^",
|
||||
"@backstage/plugin-api-docs": "workspace:^",
|
||||
|
||||
@@ -48,7 +48,7 @@ import {
|
||||
scmIntegrationsApiRef,
|
||||
} from '@backstage/integration-react';
|
||||
import kubernetesPlugin from '@backstage/plugin-kubernetes/alpha';
|
||||
import { signInPageOverrides } from './overrides/SignInPage';
|
||||
import { signInPageModule } from './overrides/SignInPage';
|
||||
import { convertLegacyPlugin } from '@backstage/core-compat-api';
|
||||
import { convertLegacyPageExtension } from '@backstage/core-compat-api';
|
||||
import { convertLegacyEntityContentExtension } from '@backstage/plugin-catalog-react/alpha';
|
||||
@@ -154,7 +154,7 @@ const app = createApp({
|
||||
homePlugin,
|
||||
appVisualizerPlugin,
|
||||
kubernetesPlugin,
|
||||
signInPageOverrides,
|
||||
signInPageModule,
|
||||
scmModule,
|
||||
notFoundErrorPageModule,
|
||||
customHomePageModule,
|
||||
|
||||
@@ -14,32 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import { CookieAuthRedirect } from '@backstage/plugin-auth-react';
|
||||
import { createApp } from '@backstage/frontend-app-api';
|
||||
import { signInPageOverrides } from './overrides/SignInPage';
|
||||
import {
|
||||
coreExtensionData,
|
||||
createExtension,
|
||||
createExtensionOverrides,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
import { signInPageModule } from './overrides/SignInPage';
|
||||
import { createPublicSignInApp } from '@backstage/frontend-defaults';
|
||||
|
||||
const authRedirectExtension = createExtension({
|
||||
namespace: 'app',
|
||||
name: 'layout',
|
||||
attachTo: { id: 'app/root', input: 'children' },
|
||||
output: [coreExtensionData.reactElement],
|
||||
factory: () => [coreExtensionData.reactElement(<CookieAuthRedirect />)],
|
||||
});
|
||||
|
||||
const app = createApp({
|
||||
features: [
|
||||
signInPageOverrides,
|
||||
createExtensionOverrides({
|
||||
extensions: [authRedirectExtension],
|
||||
}),
|
||||
],
|
||||
const app = createPublicSignInApp({
|
||||
features: [signInPageModule],
|
||||
});
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')!).render(app.createRoot());
|
||||
|
||||
@@ -18,7 +18,7 @@ import React from 'react';
|
||||
import { SignInPage } from '@backstage/core-components';
|
||||
import {
|
||||
SignInPageBlueprint,
|
||||
createExtensionOverrides,
|
||||
createFrontendModule,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
|
||||
const signInPage = SignInPageBlueprint.make({
|
||||
@@ -29,6 +29,7 @@ const signInPage = SignInPageBlueprint.make({
|
||||
},
|
||||
});
|
||||
|
||||
export const signInPageOverrides = createExtensionOverrides({
|
||||
export const signInPageModule = createFrontendModule({
|
||||
pluginId: 'app',
|
||||
extensions: [signInPage],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user