Browse Source
Merge pull request #2914 from Budibase/fix/tenant-check-fix
Fixing tenancy check
gh-pages
Michael Drury
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
packages/server/src/middleware/currentapp.js
|
|
|
@ -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.") |
|
|
|
} |
|
|
|
|