@pristine-ts/jwt 2.0.4 → 2.0.5

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.
@@ -1,8 +1,8 @@
1
- import { LoggableError } from "@pristine-ts/common";
1
+ import { PristineError } from "@pristine-ts/common";
2
2
  /**
3
3
  * This Error is thrown when you try to decode a JWT but the token is invalid.
4
4
  */
5
- export class InvalidJwtError extends LoggableError {
5
+ export class InvalidJwtError extends PristineError {
6
6
  /**
7
7
  * This Error is thrown when you try to decode a JWT but the token is invalid.
8
8
  * @param message The error message to show.
@@ -13,17 +13,13 @@ export class InvalidJwtError extends LoggableError {
13
13
  * @param publicKey The public key used to decode the JWT.
14
14
  */
15
15
  constructor(message, previousError, request, token, algorithm, publicKey) {
16
- super(message, {
17
- request,
18
- previousError,
19
- token,
20
- algorithm,
21
- publicKey,
22
- });
23
- // Set the prototype explicitly.
24
- // As specified in the documentation in TypeScript
25
- // https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
26
- Object.setPrototypeOf(this, InvalidJwtError.prototype);
16
+ super(message, { details: {
17
+ request,
18
+ previousError,
19
+ token,
20
+ algorithm,
21
+ publicKey,
22
+ } });
27
23
  }
28
24
  }
29
25
  //# sourceMappingURL=invalid-jwt.error.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"invalid-jwt.error.js","sourceRoot":"","sources":["../../../../src/errors/invalid-jwt.error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAU,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,aAAa;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"}
1
+ {"version":3,"file":"invalid-jwt.error.js","sourceRoot":"","sources":["../../../../src/errors/invalid-jwt.error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAU,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,aAAa;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"}
@@ -1,21 +1,17 @@
1
- import { LoggableError } from "@pristine-ts/common";
1
+ import { PristineError } from "@pristine-ts/common";
2
2
  /**
3
3
  * This Error is thrown when there's you try to decode a JWT in a request but the AuthorizationHeader is missing.
4
4
  */
5
- export class JwtAuthorizationHeaderError extends LoggableError {
5
+ export class JwtAuthorizationHeaderError extends PristineError {
6
6
  /**
7
7
  * This Error is thrown when there's you try to decode a JWT in a request but the AuthorizationHeader is missing.
8
8
  * @param message The error message.
9
9
  * @param request The request that is missing the AuthorizationHeader.
10
10
  */
11
11
  constructor(message, request) {
12
- super(message, {
13
- request,
14
- });
15
- // Set the prototype explicitly.
16
- // As specified in the documentation in TypeScript
17
- // https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
18
- Object.setPrototypeOf(this, JwtAuthorizationHeaderError.prototype);
12
+ super(message, { details: {
13
+ request,
14
+ } });
19
15
  }
20
16
  }
21
17
  //# sourceMappingURL=jwt-authorization-header.error.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"jwt-authorization-header.error.js","sourceRoot":"","sources":["../../../../src/errors/jwt-authorization-header.error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAU,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,MAAM,OAAO,2BAA4B,SAAQ,aAAa;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"}
1
+ {"version":3,"file":"jwt-authorization-header.error.js","sourceRoot":"","sources":["../../../../src/errors/jwt-authorization-header.error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAU,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,MAAM,OAAO,2BAA4B,SAAQ,aAAa;IAC5D;;;;OAIG;IACH,YAAmB,OAAe,EAAE,OAAgB;QAClD,KAAK,CAAC,OAAO,EAAE,EAAC,OAAO,EAAE;gBACvB,OAAO;aACR,EAAC,CAAC,CAAC;IAAE,CAAC;CACV"}