@arcblock/jwt 1.18.50 → 1.18.52
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/lib/index.js +8 -1
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -50,7 +50,14 @@ function sign(signer, sk, payload = {}, doSign = true, version = '1.0.0') {
|
|
|
50
50
|
const headerB64 = (0, util_1.toBase64)((0, json_stable_stringify_1.default)(header));
|
|
51
51
|
// make body
|
|
52
52
|
const now = Math.floor(Date.now() / 1000);
|
|
53
|
-
const body =
|
|
53
|
+
const body = {
|
|
54
|
+
iss: (0, did_1.toDid)(signer),
|
|
55
|
+
iat: String(now),
|
|
56
|
+
nbf: String(now),
|
|
57
|
+
exp: String(now + 5 * 60),
|
|
58
|
+
version,
|
|
59
|
+
...(payload || {}),
|
|
60
|
+
};
|
|
54
61
|
// remove empty keys
|
|
55
62
|
Object.keys(body).forEach((x) => {
|
|
56
63
|
if (typeof body[x] === 'undefined' || body[x] == null || body[x] === '') {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/jwt",
|
|
3
3
|
"description": "JSON Web Token variant for arcblock DID solutions",
|
|
4
|
-
"version": "1.18.
|
|
4
|
+
"version": "1.18.52",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "wangshijun",
|
|
7
7
|
"email": "shijun@arcblock.io",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@arcblock/did": "1.18.
|
|
22
|
-
"@ocap/mcrypto": "1.18.
|
|
23
|
-
"@ocap/util": "1.18.
|
|
21
|
+
"@arcblock/did": "1.18.52",
|
|
22
|
+
"@ocap/mcrypto": "1.18.52",
|
|
23
|
+
"@ocap/util": "1.18.52",
|
|
24
24
|
"debug": "^4.3.4",
|
|
25
25
|
"json-stable-stringify": "^1.0.1",
|
|
26
26
|
"semver": "^7.3.8"
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"build:watch": "npm run build -- -w",
|
|
65
65
|
"build": "tsc"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "96239c70a503c2a045dbef508c3086251dee7ce5"
|
|
68
68
|
}
|