@go-mailer/jarvis 5.0.6 → 5.0.8

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.
@@ -90,11 +90,11 @@ const authenticateUser = async (request, response, next) => {
90
90
  }
91
91
  }
92
92
 
93
- const authorizeUser = async ({ action, resource }) => {
93
+ const authorizeUser = ({ action, resource }) => {
94
94
  return async (request, response, next) => {
95
95
  try {
96
96
  const { is_admin, tenant_id, user_id } = request
97
- if (is_admin) next()
97
+ if (is_admin) return next()
98
98
 
99
99
  await checkAuthority({ action, resource, tenant_id, user_id })
100
100
  next()
@@ -53,7 +53,7 @@ function RequestLogger () {
53
53
  status_code: payload ? payload.status_code : statusCode
54
54
  }
55
55
 
56
- const error = payload ? payload.error : statusMessage
56
+ log.error = payload ? payload.error : statusMessage
57
57
  // if (error) {
58
58
  // log.error = error;
59
59
  // logtail.error(pathname, hashLogData(log));
@@ -62,7 +62,7 @@ function RequestLogger () {
62
62
  // }
63
63
 
64
64
  // logtail.flush();
65
- console.log(pathname, hashLogData({ ...log, error }))
65
+ console.log(pathname, hashLogData({ status_code: log.status_code, request_id: log.request_id }))
66
66
  })
67
67
 
68
68
  next()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-mailer/jarvis",
3
- "version": "5.0.6",
3
+ "version": "5.0.8",
4
4
  "main": "index.js",
5
5
  "repository": "git@github.com:go-mailer-ltd/jarvis-node.git",
6
6
  "author": "Nathan Oguntuberu <nateoguns.work@gmail.com>",