c2-http 1.0.126 → 1.0.127

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.
@@ -18,7 +18,7 @@ class MiddlewareCheckScopesFlow {
18
18
  response
19
19
  .status(http_status_1.UNAUTHORIZED)
20
20
  .json({ message: (0, i18n_1.getMessage)("message.authorization.userAccessNotAllowed", scopesRequireds?.join(", ")) });
21
- return;
21
+ return next((0, i18n_1.getMessage)("message.authorization.userAccessNotAllowed", scopesRequireds?.join(", ")));
22
22
  }
23
23
  next();
24
24
  };
@@ -23,12 +23,13 @@ class MiddlewareCheckTokenFlow {
23
23
  next();
24
24
  return;
25
25
  }
26
- await this.checkToken(response, next);
26
+ return await this.checkToken(response, next);
27
27
  }
28
28
  catch (error) {
29
29
  response
30
30
  .status(error.status || http_status_1.INTERNAL_SERVER_ERROR)
31
31
  .json({ message: error.message, detail: error.detail?.data });
32
+ return next(error);
32
33
  }
33
34
  };
34
35
  async checkToken(response, next) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-http",
3
- "version": "1.0.126",
3
+ "version": "1.0.127",
4
4
  "description": "Biblioteca Typescript para API NodeJS",
5
5
  "repository": "https://cabralsilva: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@github.com/cabralsilva/c2-http.git",
6
6
  "author": "Daniel Cabral <cabralconsultoriaemsoftware@gmail.com>",