c2-http 1.0.138 → 1.0.140
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.
|
@@ -25,9 +25,11 @@ class MiddlewareCheckTokenFlow {
|
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
await this.checkToken();
|
|
28
|
+
(0, c2_util_1.log)("LOG_CHECK_TOKEN", "Token checked");
|
|
28
29
|
return next();
|
|
29
30
|
}
|
|
30
31
|
catch (error) {
|
|
32
|
+
(0, c2_util_1.log)("LOG_ERROR_CHECK_TOKEN", error);
|
|
31
33
|
response
|
|
32
34
|
.status(error.status || http_status_1.INTERNAL_SERVER_ERROR)
|
|
33
35
|
.json({ message: error.message, detail: error.detail?.data });
|
package/dist/model/Server.js
CHANGED
|
@@ -40,13 +40,13 @@ class Server {
|
|
|
40
40
|
// this.app.use("/docs", swaggerUI.serve, swaggerUI.setup((global as any).OPEN_API_DOC))
|
|
41
41
|
(0, c2_util_1.log)("LOG", "Rotas abertas OK");
|
|
42
42
|
//middlewares de checagem de token obrigatorio
|
|
43
|
-
|
|
43
|
+
this.app.use(MiddlewareJwt_1.default.config);
|
|
44
44
|
//middlewares de checagem de token opcional
|
|
45
45
|
// this.config.middlewaresCloseControllers?.forEach((middl: RequestHandler) => {
|
|
46
46
|
// this.app.use(middl)
|
|
47
47
|
// })
|
|
48
48
|
for (const closeRouter of this.config.closeControllers.map(c => c.router)) {
|
|
49
|
-
closeRouter.use(
|
|
49
|
+
// closeRouter.use(MiddlewareJwt.config, ...(this.config.middlewaresCloseControllers?.map(m => m) ?? []))
|
|
50
50
|
this.app.use(closeRouter);
|
|
51
51
|
}
|
|
52
52
|
(0, c2_util_1.log)("LOG", "Rotas fechadas OK");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c2-http",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.140",
|
|
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>",
|