fix: initialize configured auth in production builds
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@wrnexus/cli",
|
||||
"version": "0.8.50",
|
||||
"version": "0.8.51",
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
"exports": {
|
||||
|
||||
@@ -702,6 +702,15 @@ applyAuthzManifestEarly([${authzSetupEntries}]);
|
||||
imports.push(`import "./.authz-setup.ts";`);
|
||||
}
|
||||
|
||||
// Runtime plugin state (notably the configured auth engine and OAuth
|
||||
// providers) is established by evaluating the application config. The build
|
||||
// process runs in a different process, so its globals cannot serve the
|
||||
// generated production server.
|
||||
const runtimeConfigPath = ["wrnexus.config.ts", "wrnexus.config.js", "wrnexus.config.mjs"]
|
||||
.map((name) => join(appRoot, name))
|
||||
.find(existsSync);
|
||||
if (runtimeConfigPath) imports.push(`import ${JSON.stringify(fwd(runtimeConfigPath))};`);
|
||||
|
||||
const manifestRoutes = (routes: Route[]): string => {
|
||||
const parts = routes.map((r) => {
|
||||
const v = `m${counter++}`;
|
||||
|
||||
Reference in New Issue
Block a user