@pristine-ts/jwt 2.0.4 → 2.0.6

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.
@@ -5,7 +5,7 @@ const common_1 = require("@pristine-ts/common");
5
5
  /**
6
6
  * This Error is thrown when you try to decode a JWT but the token is invalid.
7
7
  */
8
- class InvalidJwtError extends common_1.LoggableError {
8
+ class InvalidJwtError extends common_1.PristineError {
9
9
  /**
10
10
  * This Error is thrown when you try to decode a JWT but the token is invalid.
11
11
  * @param message The error message to show.
@@ -16,17 +16,13 @@ class InvalidJwtError extends common_1.LoggableError {
16
16
  * @param publicKey The public key used to decode the JWT.
17
17
  */
18
18
  constructor(message, previousError, request, token, algorithm, publicKey) {
19
- super(message, {
20
- request,
21
- previousError,
22
- token,
23
- algorithm,
24
- publicKey,
25
- });
26
- // Set the prototype explicitly.
27
- // As specified in the documentation in TypeScript
28
- // https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
29
- Object.setPrototypeOf(this, InvalidJwtError.prototype);
19
+ super(message, { details: {
20
+ request,
21
+ previousError,
22
+ token,
23
+ algorithm,
24
+ publicKey,
25
+ } });
30
26
  }
31
27
  }
32
28
  exports.InvalidJwtError = InvalidJwtError;
@@ -1 +1 @@
1
- {"version":3,"file":"invalid-jwt.error.js","sourceRoot":"","sources":["../../../../src/errors/invalid-jwt.error.ts"],"names":[],"mappings":";;;AAAA,gDAA2D;AAE3D;;GAEG;AACH,MAAa,eAAgB,SAAQ,sBAAa;IAEhD;;;;;;;;OAQG;IACH,YAAmB,OAAe,EAAE,aAAoB,EAAE,OAAgB,EAAE,KAAa,EAAE,SAAiB,EAAE,SAAiB;QAC7H,KAAK,CAAC,OAAO,EAAE;YACb,OAAO;YACP,aAAa;YACb,KAAK;YACL,SAAS;YACT,SAAS;SACV,CAAC,CAAC;QAEH,gCAAgC;QAChC,kDAAkD;QAClD,gIAAgI;QAChI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;CACF;AAzBD,0CAyBC"}
1
+ {"version":3,"file":"invalid-jwt.error.js","sourceRoot":"","sources":["../../../../src/errors/invalid-jwt.error.ts"],"names":[],"mappings":";;;AAAA,gDAA2D;AAE3D;;GAEG;AACH,MAAa,eAAgB,SAAQ,sBAAa;IAEhD;;;;;;;;OAQG;IACH,YAAmB,OAAe,EAAE,aAAoB,EAAE,OAAgB,EAAE,KAAa,EAAE,SAAiB,EAAE,SAAiB;QAC7H,KAAK,CAAC,OAAO,EAAE,EAAC,OAAO,EAAE;gBACvB,OAAO;gBACP,aAAa;gBACb,KAAK;gBACL,SAAS;gBACT,SAAS;aACV,EAAC,CAAC,CAAC;IAAE,CAAC;CACV;AAnBD,0CAmBC"}
@@ -5,20 +5,16 @@ const common_1 = require("@pristine-ts/common");
5
5
  /**
6
6
  * This Error is thrown when there's you try to decode a JWT in a request but the AuthorizationHeader is missing.
7
7
  */
8
- class JwtAuthorizationHeaderError extends common_1.LoggableError {
8
+ class JwtAuthorizationHeaderError extends common_1.PristineError {
9
9
  /**
10
10
  * This Error is thrown when there's you try to decode a JWT in a request but the AuthorizationHeader is missing.
11
11
  * @param message The error message.
12
12
  * @param request The request that is missing the AuthorizationHeader.
13
13
  */
14
14
  constructor(message, request) {
15
- super(message, {
16
- request,
17
- });
18
- // Set the prototype explicitly.
19
- // As specified in the documentation in TypeScript
20
- // https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
21
- Object.setPrototypeOf(this, JwtAuthorizationHeaderError.prototype);
15
+ super(message, { details: {
16
+ request,
17
+ } });
22
18
  }
23
19
  }
24
20
  exports.JwtAuthorizationHeaderError = JwtAuthorizationHeaderError;
@@ -1 +1 @@
1
- {"version":3,"file":"jwt-authorization-header.error.js","sourceRoot":"","sources":["../../../../src/errors/jwt-authorization-header.error.ts"],"names":[],"mappings":";;;AAAA,gDAA2D;AAE3D;;GAEG;AACH,MAAa,2BAA4B,SAAQ,sBAAa;IAC5D;;;;OAIG;IACH,YAAmB,OAAe,EAAE,OAAgB;QAClD,KAAK,CAAC,OAAO,EAAE;YACb,OAAO;SACR,CAAC,CAAC;QAEH,gCAAgC;QAChC,kDAAkD;QAClD,gIAAgI;QAChI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,2BAA2B,CAAC,SAAS,CAAC,CAAC;IACrE,CAAC;CACF;AAhBD,kEAgBC"}
1
+ {"version":3,"file":"jwt-authorization-header.error.js","sourceRoot":"","sources":["../../../../src/errors/jwt-authorization-header.error.ts"],"names":[],"mappings":";;;AAAA,gDAA2D;AAE3D;;GAEG;AACH,MAAa,2BAA4B,SAAQ,sBAAa;IAC5D;;;;OAIG;IACH,YAAmB,OAAe,EAAE,OAAgB;QAClD,KAAK,CAAC,OAAO,EAAE,EAAC,OAAO,EAAE;gBACvB,OAAO;aACR,EAAC,CAAC,CAAC;IAAE,CAAC;CACV;AAVD,kEAUC"}