exodus-framework 2.0.56 → 2.0.58

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":"authentication.d.ts","sourceRoot":"","sources":["../../src/middlewares/authentication.ts"],"names":[],"mappings":"AACA,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,cAAM,wBAAyB,SAAQ,cAAc;IACnD,YAAY,EAAE,cAAc,CAOzB;CACJ;AAED,eAAe,wBAAwB,CAAC"}
1
+ {"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../src/middlewares/authentication.ts"],"names":[],"mappings":"AACA,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,cAAM,wBAAyB,SAAQ,cAAc;IACnD,YAAY,EAAE,cAAc,CAYzB;CACJ;AAED,eAAe,wBAAwB,CAAC"}
@@ -12,8 +12,13 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
12
12
  class AuthenticationMiddleware extends _controller.default {
13
13
  decryptToken = (0, _expressJwt.expressjwt)({
14
14
  secret: async () => {
15
- const api = new _session.SessionAPI();
16
- return (await api.getCertificate()).data;
15
+ try {
16
+ const api = new _session.SessionAPI();
17
+ return (await api.getCertificate()).data;
18
+ } catch (error) {
19
+ this.log('Não foi possível obter o certificado de segurança.', 'danger');
20
+ return '';
21
+ }
17
22
  },
18
23
  issuer: _app.Core.settings.getAuthentication().issuer,
19
24
  algorithms: ['RS256']
@@ -10,7 +10,6 @@ var _cors = _interopRequireDefault(require("cors"));
10
10
  var _express = _interopRequireDefault(require("express"));
11
11
  require("express-async-errors");
12
12
  var http = _interopRequireWildcard(require("http"));
13
- var _path = _interopRequireDefault(require("path"));
14
13
  var _pinoHttp = _interopRequireDefault(require("pino-http"));
15
14
  var _http2 = require("../contracts/http");
16
15
  var _error = require("./error");
@@ -29,7 +28,7 @@ class ExpressService extends _service.default {
29
28
  logger: (0, _logger.default)()
30
29
  });
31
30
  this.server = http.createServer(expss);
32
- expss.use('/public', _express.default.static(_path.default.join(__dirname, '../../public')));
31
+ expss.use('/public', _express.default.static(_app.Core.settings.getHttp().publicPath));
33
32
  expss.use(pino);
34
33
  expss.use(this.responseTypeMiddleware.bind(this));
35
34
  expss.use(_express.default.json());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exodus-framework",
3
- "version": "2.0.56",
3
+ "version": "2.0.58",
4
4
  "description": "Exodus Framework",
5
5
  "author": "jhownpaixao",
6
6
  "license": "ISC",