From a9d9e14e2286a9e04d4b6ca304aebda6ec3e5324 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Sun, 18 Oct 2020 21:45:46 +0100 Subject: [PATCH] auth - standard-components not loading, windows --- packages/client/src/index.js | 2 +- packages/server/src/api/controllers/static.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/client/src/index.js b/packages/client/src/index.js index 8324eb8270..6bbe2aee2b 100644 --- a/packages/client/src/index.js +++ b/packages/client/src/index.js @@ -21,7 +21,7 @@ export const loadBudibase = async opts => { for (let library of libraries) { // fetch the JavaScript for the component libraries from the server componentLibraryModules[library] = await import( - `/componentlibrary?library=${encodeURI(library)}` + `/componentlibrary?library=${encodeURI(library)}&appId=${appId}` ) } diff --git a/packages/server/src/api/controllers/static.js b/packages/server/src/api/controllers/static.js index 2abb0069ab..f993876cfb 100644 --- a/packages/server/src/api/controllers/static.js +++ b/packages/server/src/api/controllers/static.js @@ -198,7 +198,7 @@ exports.serveComponentLibrary = async function(ctx) { // default to homedir let componentLibraryPath = resolve( budibaseAppsDir(), - ctx.user.appId, + ctx.query.appId, "node_modules", decodeURI(ctx.query.library), "package", @@ -215,7 +215,7 @@ exports.serveComponentLibrary = async function(ctx) { // TODO: component libs should be versioned based on app version if (process.env.CLOUD) { - const appId = ctx.user.appId + const appId = ctx.query.appId const S3_URL = encodeURI( `https://${appId}.app.budi.live/assets/componentlibrary/${ctx.query.library}/dist/index.js` )