@abtnode/auth 1.16.14-beta-d802cd3c → 1.16.14-beta-dc99d0a2

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 CHANGED
@@ -1134,11 +1134,13 @@ const setUserInfoHeaders = (req) => {
1134
1134
  req.headers['x-user-did'] = req.user.did;
1135
1135
  req.headers['x-user-fullname'] = encodeURIComponent(req.user.fullName);
1136
1136
  req.headers['x-user-role'] = req.user.role;
1137
+ req.headers['x-user-provider'] = req.user.provider || LOGIN_PROVIDER.WALLET;
1137
1138
  req.headers['x-connected-did'] = req.user.did;
1138
1139
  } else {
1139
1140
  delete req.headers['x-user-did'];
1140
1141
  delete req.headers['x-user-fullname'];
1141
1142
  delete req.headers['x-user-role'];
1143
+ delete req.headers['x-user-provider'];
1142
1144
 
1143
1145
  if (req.cookies && req.cookies.connected_did) {
1144
1146
  req.headers['x-connected-did'] = req.cookies.connected_did;
package/lib/passport.js CHANGED
@@ -180,8 +180,8 @@ const createUserPassport = (vc, { status = PASSPORT_STATUS.VALID, role = ROLES.G
180
180
  return x;
181
181
  };
182
182
 
183
- const getPassportClaimUrl = (baseUrl) =>
184
- baseUrl ? joinUrl(new URL(baseUrl).origin, WELLKNOWN_SERVICE_PATH_PREFIX, '/lost-passport') : '';
183
+ const getPassportClaimUrl = (baseUrl, prefix = '') =>
184
+ baseUrl ? joinUrl(new URL(baseUrl).origin, prefix, WELLKNOWN_SERVICE_PATH_PREFIX, '/lost-passport') : '';
185
185
 
186
186
  module.exports = {
187
187
  validatePassport,
package/lib/server.js CHANGED
@@ -286,7 +286,7 @@ const authenticateBySession = async ({ node, userDid, locale, allowedRoles = ['o
286
286
  };
287
287
 
288
288
  const getAuthVcClaim =
289
- ({ node, launchBlocklet, blocklet, options }) =>
289
+ ({ node, launchBlocklet, blocklet, options, source = 'blocklet' }) =>
290
290
  async ({ extraParams: { locale, passportId }, context: { didwallet, baseUrl } }) => {
291
291
  checkWalletVersion({ didwallet, locale });
292
292
 
@@ -321,7 +321,7 @@ const getAuthVcClaim =
321
321
  ...baseClaim,
322
322
  trustedIssuers,
323
323
  ...(options || {}),
324
- claimUrl: getPassportClaimUrl(baseUrl),
324
+ claimUrl: getPassportClaimUrl(baseUrl, source === 'server' ? info.routing.adminPath : ''),
325
325
  };
326
326
  };
327
327
 
@@ -46,7 +46,8 @@ const createPassportSvg = ({
46
46
  width,
47
47
  height,
48
48
 
49
- revoked,
49
+ tag: revoked ? 'revoked' : '',
50
+ tagVariant: revoked ? 'error' : 'info',
50
51
 
51
52
  color,
52
53
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.14-beta-d802cd3c",
6
+ "version": "1.16.14-beta-dc99d0a2",
7
7
  "description": "Simple lib to manage auth in ABT Node",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -20,14 +20,14 @@
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.14-beta-d802cd3c",
24
- "@abtnode/logger": "1.16.14-beta-d802cd3c",
25
- "@abtnode/util": "1.16.14-beta-d802cd3c",
23
+ "@abtnode/constant": "1.16.14-beta-dc99d0a2",
24
+ "@abtnode/logger": "1.16.14-beta-dc99d0a2",
25
+ "@abtnode/util": "1.16.14-beta-dc99d0a2",
26
26
  "@arcblock/did": "1.18.87",
27
- "@arcblock/nft-display": "2.5.60",
27
+ "@arcblock/nft-display": "2.5.65",
28
28
  "@arcblock/vc": "1.18.87",
29
- "@blocklet/constant": "1.16.14-beta-d802cd3c",
30
- "@blocklet/meta": "1.16.14-beta-d802cd3c",
29
+ "@blocklet/constant": "1.16.14-beta-dc99d0a2",
30
+ "@blocklet/meta": "1.16.14-beta-dc99d0a2",
31
31
  "@ocap/mcrypto": "1.18.87",
32
32
  "@ocap/util": "1.18.87",
33
33
  "@ocap/wallet": "1.18.87",
@@ -43,5 +43,5 @@
43
43
  "devDependencies": {
44
44
  "jest": "^27.5.1"
45
45
  },
46
- "gitHead": "f8e2dcefd8d6876e5dedee833ac976b4a0496b20"
46
+ "gitHead": "a00766d660ede97e2036f3a785f4f5cfb2e6d870"
47
47
  }