c2-http 1.0.135 → 1.0.137

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,7 +1,7 @@
1
1
  import { NextFunction, Request, Response } from "express";
2
2
  declare class MiddlewareCheckTokenFlow {
3
3
  config: (request: Request, response: Response, next: NextFunction) => Promise<void>;
4
- checkToken(response: Response, next: NextFunction): Promise<void>;
4
+ checkToken(): Promise<void>;
5
5
  }
6
6
  declare const _default: MiddlewareCheckTokenFlow;
7
7
  export default _default;
@@ -22,7 +22,8 @@ class MiddlewareCheckTokenFlow {
22
22
  next();
23
23
  return;
24
24
  }
25
- await this.checkToken(response, next);
25
+ await this.checkToken();
26
+ return next();
26
27
  }
27
28
  catch (error) {
28
29
  response
@@ -30,13 +31,12 @@ class MiddlewareCheckTokenFlow {
30
31
  .json({ message: error.message, detail: error.detail?.data });
31
32
  }
32
33
  };
33
- async checkToken(response, next) {
34
+ async checkToken() {
34
35
  let token = "";
35
36
  try {
36
37
  token = GetTokenFlowItem_1.default.get();
37
38
  const tokenDecoded = await ValidateTokenFlowItem_1.default.exec(token);
38
39
  AddInContextFlowItem_1.default.exec(tokenDecoded, token);
39
- next();
40
40
  }
41
41
  catch (error) {
42
42
  throw (0, __1.convertErrorToHttpError)(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-http",
3
- "version": "1.0.135",
3
+ "version": "1.0.137",
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>",
@@ -29,7 +29,7 @@
29
29
  "cookie-parser": "^1.4.7",
30
30
  "cors": "^2.8.5",
31
31
  "express": "^4.19.2",
32
- "express-http-context": "^1.2.4",
32
+ "express-http-context": "1.2.4",
33
33
  "express-prom-bundle": "^8.0.0",
34
34
  "express-rest-i18n": "^1.0.1",
35
35
  "http-status": "^1.7.4",