Browse Source

fix test failure

master
Martin McKeaveney 5 years ago
parent
commit
c1c4fe968f
  1. 4
      packages/auth/src/middleware/tenancy.js

4
packages/auth/src/middleware/tenancy.js

@ -5,13 +5,13 @@ const { buildMatcherRegex, matches } = require("./matchers")
module.exports = ( module.exports = (
allowQueryStringPatterns, allowQueryStringPatterns,
noTenancyPatterns, noTenancyPatterns,
{ noTenancyRequired } opts = {}
) => { ) => {
const allowQsOptions = buildMatcherRegex(allowQueryStringPatterns) const allowQsOptions = buildMatcherRegex(allowQueryStringPatterns)
const noTenancyOptions = buildMatcherRegex(noTenancyPatterns) const noTenancyOptions = buildMatcherRegex(noTenancyPatterns)
return ContextFactory.getMiddleware(ctx => { return ContextFactory.getMiddleware(ctx => {
const allowNoTenant = noTenancyRequired || !!matches(ctx, noTenancyOptions) const allowNoTenant = opts.noTenancyRequired || !!matches(ctx, noTenancyOptions)
const allowQs = !!matches(ctx, allowQsOptions) const allowQs = !!matches(ctx, allowQsOptions)
setTenantId(ctx, { allowQs, allowNoTenant }) setTenantId(ctx, { allowQs, allowNoTenant })
}) })

Loading…
Cancel
Save