@abtnode/auth 1.16.16-beta-740ea329 → 1.16.16-beta-301539f6
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/auth.js +6 -0
- package/package.json +13 -13
package/lib/auth.js
CHANGED
|
@@ -390,6 +390,7 @@ const createAuthToken = ({
|
|
|
390
390
|
fullName,
|
|
391
391
|
tokenType,
|
|
392
392
|
provider = LOGIN_PROVIDER.WALLET,
|
|
393
|
+
walletOS,
|
|
393
394
|
} = {}) => {
|
|
394
395
|
const payload = {
|
|
395
396
|
type: 'user',
|
|
@@ -397,6 +398,9 @@ const createAuthToken = ({
|
|
|
397
398
|
role,
|
|
398
399
|
provider,
|
|
399
400
|
};
|
|
401
|
+
if (walletOS) {
|
|
402
|
+
payload.walletOS = walletOS;
|
|
403
|
+
}
|
|
400
404
|
|
|
401
405
|
if (passport) {
|
|
402
406
|
const { id } = passport;
|
|
@@ -1140,11 +1144,13 @@ const setUserInfoHeaders = (req) => {
|
|
|
1140
1144
|
req.headers['x-user-role'] = req.user.role;
|
|
1141
1145
|
req.headers['x-user-provider'] = req.user.provider || LOGIN_PROVIDER.WALLET;
|
|
1142
1146
|
req.headers['x-connected-did'] = req.user.did;
|
|
1147
|
+
req.headers['x-user-wallet-os'] = req.user.walletOS || '';
|
|
1143
1148
|
} else {
|
|
1144
1149
|
delete req.headers['x-user-did'];
|
|
1145
1150
|
delete req.headers['x-user-fullname'];
|
|
1146
1151
|
delete req.headers['x-user-role'];
|
|
1147
1152
|
delete req.headers['x-user-provider'];
|
|
1153
|
+
delete req.headers['x-user-wallet-os'];
|
|
1148
1154
|
|
|
1149
1155
|
if (req.cookies && req.cookies.connected_did) {
|
|
1150
1156
|
req.headers['x-connected-did'] = req.cookies.connected_did;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.16-beta-
|
|
6
|
+
"version": "1.16.16-beta-301539f6",
|
|
7
7
|
"description": "Simple lib to manage auth in ABT Node",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -20,17 +20,17 @@
|
|
|
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.16-beta-
|
|
24
|
-
"@abtnode/logger": "1.16.16-beta-
|
|
25
|
-
"@abtnode/util": "1.16.16-beta-
|
|
26
|
-
"@arcblock/did": "1.18.
|
|
27
|
-
"@arcblock/nft-display": "2.7.
|
|
28
|
-
"@arcblock/vc": "1.18.
|
|
29
|
-
"@blocklet/constant": "1.16.16-beta-
|
|
30
|
-
"@blocklet/meta": "1.16.16-beta-
|
|
31
|
-
"@ocap/mcrypto": "1.18.
|
|
32
|
-
"@ocap/util": "1.18.
|
|
33
|
-
"@ocap/wallet": "1.18.
|
|
23
|
+
"@abtnode/constant": "1.16.16-beta-301539f6",
|
|
24
|
+
"@abtnode/logger": "1.16.16-beta-301539f6",
|
|
25
|
+
"@abtnode/util": "1.16.16-beta-301539f6",
|
|
26
|
+
"@arcblock/did": "1.18.90",
|
|
27
|
+
"@arcblock/nft-display": "2.7.20",
|
|
28
|
+
"@arcblock/vc": "1.18.90",
|
|
29
|
+
"@blocklet/constant": "1.16.16-beta-301539f6",
|
|
30
|
+
"@blocklet/meta": "1.16.16-beta-301539f6",
|
|
31
|
+
"@ocap/mcrypto": "1.18.90",
|
|
32
|
+
"@ocap/util": "1.18.90",
|
|
33
|
+
"@ocap/wallet": "1.18.90",
|
|
34
34
|
"fs-extra": "^10.1.0",
|
|
35
35
|
"joi": "17.7.0",
|
|
36
36
|
"jsonwebtoken": "^9.0.0",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"jest": "^27.5.1"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "4abf42f8b8cc859b76a85ab083414654dea10fcb"
|
|
47
47
|
}
|