@otters.ai/common-backend 1.0.11 → 1.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.
@@ -1,4 +1,4 @@
1
- export declare class JwtService {
1
+ export default class JwtService {
2
2
  verifyJSONToken(filters: {
3
3
  salt: string;
4
4
  token: string;
@@ -3,24 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.JwtService = void 0;
7
6
  const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
8
7
  class JwtService {
9
8
  verifyJSONToken(filters) {
10
9
  try {
11
10
  let verify = jsonwebtoken_1.default.verify(filters.token, filters.salt);
12
- // @ts-ignore
13
- return { flag: true, message: verify.data };
11
+ return { flag: true, message: typeof verify === "string" ? '' : verify.data };
14
12
  }
15
13
  catch (e) {
16
- // @ts-ignore
17
14
  if (e.message === "jwt expired" || e.message === "invalid signature") {
18
- // @ts-ignore
19
15
  e.message = "Session Expired(jwt), Please Login to continue.";
20
16
  }
21
- // @ts-ignore
22
17
  return { flag: false, message: e.message };
23
18
  }
24
19
  }
25
20
  }
26
- exports.JwtService = JwtService;
21
+ exports.default = JwtService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otters.ai/common-backend",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",