@ecom-micro/common 2.0.11 → 2.0.13

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.
@@ -21,12 +21,12 @@ var NotAuthorizedError = /** @class */ (function (_super) {
21
21
  __extends(NotAuthorizedError, _super);
22
22
  function NotAuthorizedError() {
23
23
  var _this = _super.call(this, 'Not authorized') || this;
24
- _this.statusCode = 401;
24
+ _this.statusCode = 403;
25
25
  Object.setPrototypeOf(_this, NotAuthorizedError.prototype);
26
26
  return _this;
27
27
  }
28
28
  NotAuthorizedError.prototype.serializeErrors = function () {
29
- return [{ message: 'Not authorized' }];
29
+ return [{ message: 'Oops! You are not authorized to access this route' }];
30
30
  };
31
31
  return NotAuthorizedError;
32
32
  }(baseError_1.BaseError));
@@ -2,7 +2,7 @@ import { NextFunction, Request, Response } from 'express';
2
2
  type UserPayload = {
3
3
  id: string;
4
4
  email: string;
5
- role?: string;
5
+ role: string;
6
6
  };
7
7
  declare global {
8
8
  namespace Express {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecom-micro/common",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",