Fixed the SPA authentication flow
This commit is contained in:
@@ -25,7 +25,7 @@ function composeScript(target, { bootstrap = true } = {}) {
|
||||
.map(file => fs.readFileSync(path.join(root, file), "utf8")).join("\n");
|
||||
parts.unshift(`const redwoodStyles = ${JSON.stringify(css)};`);
|
||||
}
|
||||
const factory = target === "content" ? "createContentApplication" : "createBackgroundApplication";
|
||||
const factory = { content: "createContentApplication", background: "createBackgroundApplication", "spa-page": "createSpaPage" }[target];
|
||||
const ending = bootstrap ? `${factory}().start();` : `return ${factory};`;
|
||||
const output = `(function () {\n "use strict";\n${parts.join("\n")}\n${ending}\n})();\n`;
|
||||
new vm.Script(output, { filename: `${target}.js` });
|
||||
|
||||
Reference in New Issue
Block a user