exodus-framework 2.0.859 → 2.0.860

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../../src/middlewares/access.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAM5C,cAAM,gBAAiB,SAAQ,cAAc;IAC3C,WAAW,UAAW,YAAY,EAAE,KAAG,cAAc,CAWnD;IAEF,SAAS,EAAE,cAAc,CAwEvB;CACH;AAED,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../../src/middlewares/access.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAM5C,cAAM,gBAAiB,SAAQ,cAAc;IAC3C,WAAW,UAAW,YAAY,EAAE,KAAG,cAAc,CAWnD;IAEF,SAAS,EAAE,cAAc,CA6EvB;CACH;AAED,eAAe,gBAAgB,CAAC"}
@@ -77,11 +77,17 @@ class AccessMiddleware extends _controller.default {
77
77
  envUuid = data.payload.envUuid;
78
78
  }
79
79
  } else if (tenantId) {
80
+ if (!account) {
81
+ throw new _app.HttpError({
82
+ message: 'Não é permitido o uso do tenantId sem uma sessão ativa',
83
+ statusCode: _http.EHttpResponseCode.informationBlocked
84
+ });
85
+ }
80
86
  envUuid = tenantId;
81
- }
82
- if (account && account.type != 'ADMINISTRATOR') {
83
- requestor.environmentId = account.envUuid;
84
- envUuid = account.envUuid;
87
+ if (account.type != 'ADMINISTRATOR') {
88
+ requestor.environmentId = account.envUuid;
89
+ envUuid = account.envUuid;
90
+ }
85
91
  }
86
92
  req.tenant = {
87
93
  id: envUuid || _app.Core.settings.getDatabase().service.database
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exodus-framework",
3
- "version": "2.0.859",
3
+ "version": "2.0.860",
4
4
  "description": "Exodus Framework",
5
5
  "author": "jhownpaixao",
6
6
  "license": "ISC",