Browse Source
Merge pull request #3991 from Budibase/fix/load-apps-in-default-multi-tenant
Fix: Load apps when using the default multi tenant
pull/4004/head
Rory Powell
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
5 deletions
-
packages/auth/src/db/utils.js
|
|
|
@ -224,8 +224,15 @@ exports.getAllDbs = async () => { |
|
|
|
} |
|
|
|
} |
|
|
|
let couchUrl = `${exports.getCouchUrl()}/_all_dbs` |
|
|
|
if (env.MULTI_TENANCY) { |
|
|
|
let tenantId = getTenantId() |
|
|
|
let tenantId = getTenantId() |
|
|
|
if (!env.MULTI_TENANCY || tenantId == DEFAULT_TENANT_ID) { |
|
|
|
// just get all DBs when:
|
|
|
|
// - single tenancy
|
|
|
|
// - default tenant
|
|
|
|
// - apps dbs don't contain tenant id
|
|
|
|
// - non-default tenant dbs are filtered out application side in getAllApps
|
|
|
|
await addDbs(couchUrl) |
|
|
|
} else { |
|
|
|
// get prod apps
|
|
|
|
await addDbs( |
|
|
|
exports.getStartEndKeyURL(couchUrl, DocumentTypes.APP, tenantId) |
|
|
|
@ -236,9 +243,6 @@ exports.getAllDbs = async () => { |
|
|
|
) |
|
|
|
// add global db name
|
|
|
|
dbs.push(getGlobalDBName(tenantId)) |
|
|
|
} else { |
|
|
|
// just get all DBs in self host
|
|
|
|
await addDbs(couchUrl) |
|
|
|
} |
|
|
|
return dbs |
|
|
|
} |
|
|
|
|