@tachybase/auth 1.0.6 → 1.0.25

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.
@@ -17,4 +17,6 @@ export declare class JwtService {
17
17
  * @description Block a token so that this token can no longer be used
18
18
  */
19
19
  block(token: string): Promise<any>;
20
+ getSecret(): string;
21
+ verifyToken(token: string): Promise<JwtPayload>;
20
22
  }
@@ -83,6 +83,19 @@ const _JwtService = class _JwtService {
83
83
  return null;
84
84
  }
85
85
  }
86
+ getSecret() {
87
+ return this.options.secret;
88
+ }
89
+ verifyToken(token) {
90
+ return new Promise((resolve, reject) => {
91
+ import_jsonwebtoken.default.verify(token, this.secret(), (err, decoded) => {
92
+ if (err) {
93
+ return reject(err);
94
+ }
95
+ resolve(decoded);
96
+ });
97
+ });
98
+ }
86
99
  };
87
100
  __name(_JwtService, "JwtService");
88
101
  let JwtService = _JwtService;
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@tachybase/auth",
3
- "version": "1.0.6",
3
+ "version": "1.0.25",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./lib/index.js",
7
7
  "types": "./lib/index.d.ts",
8
8
  "dependencies": {
9
9
  "jsonwebtoken": "^8.5.1",
10
- "@tachybase/actions": "1.0.6",
11
- "@tachybase/database": "1.0.6",
12
- "@tachybase/resourcer": "1.0.6",
13
- "@tachybase/utils": "1.0.6",
14
- "@tachybase/cache": "1.0.6"
10
+ "@tachybase/actions": "1.0.25",
11
+ "@tachybase/cache": "1.0.25",
12
+ "@tachybase/database": "1.0.25",
13
+ "@tachybase/resourcer": "1.0.25",
14
+ "@tachybase/utils": "1.0.25"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/jsonwebtoken": "^8.5.9",