@abtnode/auth 1.16.13-beta-118c3420 → 1.16.13-beta-423a40b1

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.
Files changed (2) hide show
  1. package/lib/auth.js +5 -1
  2. package/package.json +7 -7
package/lib/auth.js CHANGED
@@ -376,7 +376,7 @@ const getApplicationInfo = async ({ node, nodeInfo = {}, teamDid }) => {
376
376
  };
377
377
  };
378
378
 
379
- const createAuthToken = ({ did, passport, role, secret, expiresIn } = {}) => {
379
+ const createAuthToken = ({ did, passport, role, secret, expiresIn, tokenType } = {}) => {
380
380
  const payload = {
381
381
  type: 'user',
382
382
  did,
@@ -390,6 +390,10 @@ const createAuthToken = ({ did, passport, role, secret, expiresIn } = {}) => {
390
390
  };
391
391
  }
392
392
 
393
+ if (tokenType) {
394
+ payload.tokenType = tokenType;
395
+ }
396
+
393
397
  const token = jwt.sign(payload, secret, { expiresIn });
394
398
  return token;
395
399
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.13-beta-118c3420",
6
+ "version": "1.16.13-beta-423a40b1",
7
7
  "description": "Simple lib to manage auth in ABT Node",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -20,13 +20,13 @@
20
20
  "author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
21
21
  "license": "Apache-2.0",
22
22
  "dependencies": {
23
- "@abtnode/constant": "1.16.13-beta-118c3420",
24
- "@abtnode/logger": "1.16.13-beta-118c3420",
25
- "@abtnode/util": "1.16.13-beta-118c3420",
23
+ "@abtnode/constant": "1.16.13-beta-423a40b1",
24
+ "@abtnode/logger": "1.16.13-beta-423a40b1",
25
+ "@abtnode/util": "1.16.13-beta-423a40b1",
26
26
  "@arcblock/did": "1.18.84",
27
27
  "@arcblock/vc": "1.18.84",
28
- "@blocklet/constant": "1.16.13-beta-118c3420",
29
- "@blocklet/meta": "1.16.13-beta-118c3420",
28
+ "@blocklet/constant": "1.16.13-beta-423a40b1",
29
+ "@blocklet/meta": "1.16.13-beta-423a40b1",
30
30
  "@ocap/mcrypto": "1.18.84",
31
31
  "@ocap/util": "1.18.84",
32
32
  "@ocap/wallet": "1.18.84",
@@ -42,5 +42,5 @@
42
42
  "devDependencies": {
43
43
  "jest": "^27.5.1"
44
44
  },
45
- "gitHead": "93e00311f882c8c153a1c6c3d18aa29c154f08f6"
45
+ "gitHead": "1aee04f45042bd4784ca72f9f8b93918980be4d4"
46
46
  }