1
0
Fork 0
mirror of synced 2024-07-08 15:56:23 +12:00

Merge pull request #2914 from Budibase/fix/tenant-check-fix

Fixing tenancy check
This commit is contained in:
Michael Drury 2021-10-07 08:40:30 +01:00 committed by GitHub
commit 70274321ec

View file

@ -58,7 +58,7 @@ module.exports = async (ctx, next) => {
// If user and app tenant Ids do not match, 403
if (env.MULTI_TENANCY && ctx.user) {
const userTenantId = getTenantId()
const tenantId = getTenantIDFromAppID(ctx.appId) || DEFAULT_TENANT_ID
const tenantId = getTenantIDFromAppID(appId) || DEFAULT_TENANT_ID
if (tenantId !== userTenantId) {
ctx.throw(403, "Cannot access application.")
}