From b7fe83ad175f2cefd6aee3a9a7b3167f6f2458d0 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 28 Mar 2023 18:14:04 +0100 Subject: [PATCH 1/3] Adding a check to config for isDev - don't use multi-tenant google SSO default in dev. --- packages/backend-core/src/configs/configs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend-core/src/configs/configs.ts b/packages/backend-core/src/configs/configs.ts index b461497747..305a074152 100644 --- a/packages/backend-core/src/configs/configs.ts +++ b/packages/backend-core/src/configs/configs.ts @@ -162,7 +162,7 @@ export async function getGoogleConfig(): Promise< export async function getGoogleDatasourceConfig(): Promise< GoogleInnerConfig | undefined > { - if (!env.SELF_HOSTED) { + if (!env.isDev() && !env.SELF_HOSTED) { // always use the env vars in cloud return getDefaultGoogleConfig() } From 70d91acc4170f89b2c0b8150dec5d1d8cc865dda Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 29 Mar 2023 14:19:54 +0100 Subject: [PATCH 2/3] Adding a check for the tenant ID - to make sure it is a real tenant before forcing the user out of the platform based on it. --- .../builder/src/pages/builder/_layout.svelte | 8 ++++++- packages/builder/src/stores/portal/index.js | 1 + packages/builder/src/stores/portal/tenants.js | 24 +++++++++++++++++++ packages/frontend-core/src/api/index.js | 2 ++ packages/frontend-core/src/api/tenants.js | 8 +++++++ .../src/api/controllers/system/tenants.ts | 4 ++++ .../worker/src/api/routes/system/tenants.ts | 2 ++ .../api/routes/system/tests/tenants.spec.ts | 13 ++++++++++ packages/worker/src/sdk/tenants/tenants.ts | 7 ++++++ packages/worker/src/tests/api/tenants.ts | 9 +++++++ 10 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 packages/builder/src/stores/portal/tenants.js create mode 100644 packages/frontend-core/src/api/tenants.js diff --git a/packages/builder/src/pages/builder/_layout.svelte b/packages/builder/src/pages/builder/_layout.svelte index 25b25e754c..73e2f2f5f1 100644 --- a/packages/builder/src/pages/builder/_layout.svelte +++ b/packages/builder/src/pages/builder/_layout.svelte @@ -1,6 +1,6 @@