adding subdomain checking to tenancy middleware
This commit is contained in:
parent
c9696145e0
commit
6e2508797a
|
@ -53,6 +53,11 @@ exports.setTenantId = (
|
||||||
// processed later in the chain
|
// processed later in the chain
|
||||||
tenantId = user.tenantId || header || tenantId
|
tenantId = user.tenantId || header || tenantId
|
||||||
|
|
||||||
|
// Set the tenantId from the subdomain
|
||||||
|
if (!tenantId) {
|
||||||
|
tenantId = ctx.subdomains && ctx.subdomains[0]
|
||||||
|
}
|
||||||
|
|
||||||
if (!tenantId && !allowNoTenant) {
|
if (!tenantId && !allowNoTenant) {
|
||||||
ctx.throw(403, "Tenant id not set")
|
ctx.throw(403, "Tenant id not set")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue