From 57b92d5b9675ca0af0ad2a7710f2e0b8c57ee6a0 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 14 Sep 2021 11:16:28 +0100 Subject: [PATCH] fix app fetching --- packages/auth/src/db/utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/auth/src/db/utils.js b/packages/auth/src/db/utils.js index 4c4bae565b..65f530fc7b 100644 --- a/packages/auth/src/db/utils.js +++ b/packages/auth/src/db/utils.js @@ -231,9 +231,12 @@ exports.getAllApps = async (CouchDB, { dev, all, idsOnly } = {}) => { const split = dbName.split(SEPARATOR) // it is an app, check the tenantId if (split[0] === DocumentTypes.APP) { - const noTenantId = split.length === 2 || split[1] === DocumentTypes.DEV // tenantId is always right before the UUID const possibleTenantId = split[split.length - 2] + + const noTenantId = + split.length === 2 || possibleTenantId === DocumentTypes.DEV + return ( (tenantId === DEFAULT_TENANT_ID && noTenantId) || possibleTenantId === tenantId