Bypass sign-in page in createDevApp
The dev app now automatically disables the sign-in page extension, so plugins under development don't require authentication. Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com> Made-with: Cursor
This commit is contained in:
@@ -21,7 +21,6 @@ import {
|
||||
import { within, waitFor } from '@testing-library/react';
|
||||
import { mockApis } from '@backstage/test-utils';
|
||||
import { createDevApp } from './createDevApp';
|
||||
import { default as appPlugin } from '@backstage/plugin-app';
|
||||
|
||||
describe('createDevApp', () => {
|
||||
afterEach(() => {
|
||||
@@ -46,16 +45,7 @@ describe('createDevApp', () => {
|
||||
});
|
||||
|
||||
createDevApp({
|
||||
features: [
|
||||
appPlugin.withOverrides({
|
||||
extensions: [
|
||||
appPlugin
|
||||
.getExtension('sign-in-page:app')
|
||||
.override({ disabled: true }),
|
||||
],
|
||||
}),
|
||||
testPlugin,
|
||||
],
|
||||
features: [testPlugin],
|
||||
createAppOptions: {
|
||||
advanced: {
|
||||
configLoader: async () => ({ config: mockApis.config() }),
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
FrontendFeatureLoader,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
import { createApp, CreateAppOptions } from '@backstage/frontend-defaults';
|
||||
import appPlugin from '@backstage/plugin-app';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
|
||||
/**
|
||||
@@ -55,7 +56,16 @@ export interface CreateDevAppOptions {
|
||||
export function createDevApp(options: CreateDevAppOptions): void {
|
||||
const app = createApp({
|
||||
...options.createAppOptions,
|
||||
features: options.features,
|
||||
features: [
|
||||
appPlugin.withOverrides({
|
||||
extensions: [
|
||||
appPlugin
|
||||
.getExtension('sign-in-page:app')
|
||||
.override({ disabled: true }),
|
||||
],
|
||||
}),
|
||||
...options.features,
|
||||
],
|
||||
});
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||
|
||||
Reference in New Issue
Block a user