@midwayjs/jwt 3.0.11 → 3.1.1
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.
- package/dist/index.js +5 -1
- package/dist/jwt.js +4 -4
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/jwt.js
CHANGED
|
@@ -24,7 +24,7 @@ let JwtService = class JwtService {
|
|
|
24
24
|
secretOrPrivateKey = (_a = this.jwtConfig) === null || _a === void 0 ? void 0 : _a.secret;
|
|
25
25
|
}
|
|
26
26
|
if (!secretOrPrivateKey) {
|
|
27
|
-
throw new Error('[midway
|
|
27
|
+
throw new Error('[midway:jwt] jwt secret should be set');
|
|
28
28
|
}
|
|
29
29
|
options = options !== null && options !== void 0 ? options : {};
|
|
30
30
|
options.expiresIn = (_b = options.expiresIn) !== null && _b !== void 0 ? _b : this.jwtConfig.expiresIn;
|
|
@@ -37,7 +37,7 @@ let JwtService = class JwtService {
|
|
|
37
37
|
secretOrPrivateKey = (_a = this.jwtConfig) === null || _a === void 0 ? void 0 : _a.secret;
|
|
38
38
|
}
|
|
39
39
|
if (!secretOrPrivateKey) {
|
|
40
|
-
throw new Error('[midway
|
|
40
|
+
throw new Error('[midway:jwt] provide the jwt secret please');
|
|
41
41
|
}
|
|
42
42
|
options = options !== null && options !== void 0 ? options : {};
|
|
43
43
|
options.expiresIn = (_b = options.expiresIn) !== null && _b !== void 0 ? _b : this.jwtConfig.expiresIn;
|
|
@@ -59,7 +59,7 @@ let JwtService = class JwtService {
|
|
|
59
59
|
secretOrPublicKey = (_a = this.jwtConfig) === null || _a === void 0 ? void 0 : _a.secret;
|
|
60
60
|
}
|
|
61
61
|
if (!secretOrPublicKey) {
|
|
62
|
-
throw new Error('[midway
|
|
62
|
+
throw new Error('[midway:jwt] provide the jwt secret please');
|
|
63
63
|
}
|
|
64
64
|
return jwt.verify(token, secretOrPublicKey, options);
|
|
65
65
|
}
|
|
@@ -70,7 +70,7 @@ let JwtService = class JwtService {
|
|
|
70
70
|
secretOrPublicKey = (_a = this.jwtConfig) === null || _a === void 0 ? void 0 : _a.secret;
|
|
71
71
|
}
|
|
72
72
|
if (!secretOrPublicKey) {
|
|
73
|
-
throw new Error('[midway
|
|
73
|
+
throw new Error('[midway:jwt] provide the jwt secret please');
|
|
74
74
|
}
|
|
75
75
|
return new Promise((resolve, reject) => {
|
|
76
76
|
jwt.verify(token, secretOrPublicKey, options, (err, encoded) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/jwt",
|
|
3
3
|
"description": "midway jwt component",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.1.1",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
"author": "Nawbc",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@midwayjs/core": "^3.
|
|
25
|
+
"@midwayjs/core": "^3.1.1",
|
|
26
26
|
"@midwayjs/decorator": "^3.0.10",
|
|
27
|
-
"@midwayjs/express": "^3.
|
|
28
|
-
"@midwayjs/koa": "^3.
|
|
29
|
-
"@midwayjs/mock": "^3.
|
|
30
|
-
"@midwayjs/web": "^3.
|
|
27
|
+
"@midwayjs/express": "^3.1.1",
|
|
28
|
+
"@midwayjs/koa": "^3.1.1",
|
|
29
|
+
"@midwayjs/mock": "^3.1.1",
|
|
30
|
+
"@midwayjs/web": "^3.1.1",
|
|
31
31
|
"@types/jsonwebtoken": "8.5.8"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"jsonwebtoken": "^8.5.1"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "b7a5c817d2316b93967367c34cff20a98b1ce4b7"
|
|
37
37
|
}
|