Add config to disable experimental public entry point
Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-app-backend': patch
|
||||
---
|
||||
|
||||
Added a new `app.disableExperimentalPublicEntryPoint` config option that allows you to opt out of the automatic public sign-in entry point. When set to `true`, the app backend will skip serving the public entry point to unauthenticated users, even if the app was bundled with an `index-public-experimental` entry point.
|
||||
Vendored
+9
@@ -42,5 +42,14 @@ export interface Config {
|
||||
* If you disable this, it is recommended to set a `staticFallbackHandler` instead.
|
||||
*/
|
||||
disableStaticFallbackCache?: boolean;
|
||||
|
||||
/**
|
||||
* Disables the experimental public entry point used for unauthenticated
|
||||
* sign-in pages. When the app is bundled with an
|
||||
* `index-public-experimental` entry point, the app backend will
|
||||
* automatically serve it to unauthenticated users. Set this to `true` to
|
||||
* skip that behavior and always serve the main entry point instead.
|
||||
*/
|
||||
disableExperimentalPublicEntryPoint?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -153,7 +153,12 @@ export async function createRouter(
|
||||
|
||||
const publicDistDir = resolvePath(appDistDir, 'public');
|
||||
|
||||
const enablePublicEntryPoint = await fs.pathExists(publicDistDir);
|
||||
const disableExperimentalPublicEntryPoint = config.getOptionalBoolean(
|
||||
'app.disableExperimentalPublicEntryPoint',
|
||||
);
|
||||
const enablePublicEntryPoint =
|
||||
!disableExperimentalPublicEntryPoint &&
|
||||
(await fs.pathExists(publicDistDir));
|
||||
|
||||
if (enablePublicEntryPoint) {
|
||||
logger.info(
|
||||
|
||||
Reference in New Issue
Block a user