@duvdu-v1/duvdu 1.0.20 → 1.0.21

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.
@@ -24,7 +24,7 @@ const auth = (modelName) => ((req, res, next) => __awaiter(void 0, void 0, void
24
24
  if (user.isBlocked) {
25
25
  throw new generic_error_1.GenericError('the users access is denied due to their blocked status.');
26
26
  }
27
- if (!((_b = req.session) === null || _b === void 0 ? void 0 : _b.jwt) && !user) {
27
+ if (!((_b = req.session) === null || _b === void 0 ? void 0 : _b.jwt) || !user) {
28
28
  throw new unauthenticated_error_1.UnauthenticatedError();
29
29
  }
30
30
  try {
@@ -9,7 +9,6 @@ const globalErrorHandlingMiddleware = (err, req, res, next) => {
9
9
  console.log(err);
10
10
  // custom error
11
11
  if (err instanceof custom_error_1.CustomError) {
12
- console.log(err);
13
12
  return res.status(err.statusCode).json({ errors: err.serializeError() });
14
13
  }
15
14
  // mongo dublicate error
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duvdu-v1/duvdu",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [