Adding use of the tenancy ID.
This commit is contained in:
parent
82e43e0008
commit
be6561e93d
|
@ -75,11 +75,15 @@ module.exports = (noAuthPatterns = [], opts) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const apiKey = ctx.request.headers[Headers.API_KEY]
|
const apiKey = ctx.request.headers[Headers.API_KEY]
|
||||||
|
const tenantId = ctx.request.headers[Headers.TENANT_ID]
|
||||||
// this is an internal request, no user made it
|
// this is an internal request, no user made it
|
||||||
if (!authenticated && apiKey && apiKey === env.INTERNAL_API_KEY) {
|
if (!authenticated && apiKey && apiKey === env.INTERNAL_API_KEY) {
|
||||||
authenticated = true
|
authenticated = true
|
||||||
internal = true
|
internal = true
|
||||||
}
|
}
|
||||||
|
if (!user && tenantId) {
|
||||||
|
user = { tenantId }
|
||||||
|
}
|
||||||
// be explicit
|
// be explicit
|
||||||
if (authenticated !== true) {
|
if (authenticated !== true) {
|
||||||
authenticated = false
|
authenticated = false
|
||||||
|
|
Loading…
Reference in New Issue