@abtnode/auth 1.16.31-beta-52250475 → 1.16.31-beta-a0cc72cf

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
@@ -444,8 +444,6 @@ const handleInvitationReceive = async ({
444
444
  logo,
445
445
  } = await getApplicationInfo({ node, nodeInfo, teamDid, baseUrl: endpoint });
446
446
 
447
- const { remark } = inviteInfo;
448
-
449
447
  const vcParams = {
450
448
  issuerName,
451
449
  issuerWallet,
@@ -526,7 +524,8 @@ const handleInvitationReceive = async ({
526
524
  locale,
527
525
  passport,
528
526
  lastLoginIp: getRequestIP(req),
529
- remark,
527
+ remark: inviteInfo.remark,
528
+ inviter: inviteInfo.inviter?.did,
530
529
  connectedAccount: {
531
530
  provider,
532
531
  did: userDid,
@@ -554,7 +553,8 @@ const handleInvitationReceive = async ({
554
553
  locale,
555
554
  passport,
556
555
  lastLoginIp: getRequestIP(req),
557
- remark,
556
+ inviter: inviteInfo.inviter?.did,
557
+ remark: inviteInfo.remark,
558
558
  connectedAccount: {
559
559
  provider,
560
560
  did: userDid,
@@ -593,6 +593,7 @@ const handleInvitationReceive = async ({
593
593
  },
594
594
  profile,
595
595
  user: doc,
596
+ inviteInfo,
596
597
  };
597
598
  };
598
599
 
package/lib/launcher.js CHANGED
@@ -14,10 +14,11 @@ const LAUNCHER_BLOCKLET_DID = 'z8iZkFBbrVQxZHvcWWB3Sa2TrfGmSeFz9MSU7';
14
14
  const schema = Joi.object({
15
15
  launcherSessionId: Joi.string().required(),
16
16
  launcherUrl: Joi.string().uri().required(),
17
+ locale: Joi.string().optional(),
17
18
  });
18
19
 
19
20
  // eslint-disable-next-line require-await
20
- const doRequest = async (serverSk, { launcherUrl, pathname, payload, method = 'post' }) => {
21
+ const doRequest = async (serverSk, { launcherUrl, pathname, payload, method = 'post', locale = 'en' }) => {
21
22
  if (!serverSk) {
22
23
  throw new Error('serverSk is required to request launcher');
23
24
  }
@@ -34,13 +35,16 @@ const doRequest = async (serverSk, { launcherUrl, pathname, payload, method = 'p
34
35
 
35
36
  const url = joinURL(baseURL, mountPoint.mountPoint, pathname);
36
37
 
38
+ let params = method === 'get' ? payload : {};
39
+ params = { ...(params || {}), locale };
40
+
37
41
  logger.info('do launcher request', { url, method, payload });
38
42
 
39
43
  const { data } = await axios({
40
44
  method,
41
45
  url,
42
46
  data: method !== 'get' ? payload : {},
43
- params: method === 'get' ? payload : {},
47
+ params,
44
48
  headers: {
45
49
  'x-server-sig': toBase58(wallet.sign(stableStringify(payload))),
46
50
  },
@@ -70,13 +74,14 @@ const getLauncherSession = async (serverSk, params) => {
70
74
  return { error: formatError(error) };
71
75
  }
72
76
 
73
- const { launcherSessionId, launcherUrl } = params;
77
+ const { launcherSessionId, launcherUrl, locale } = params;
74
78
  try {
75
79
  const result = await doRequest(serverSk, {
76
80
  launcherUrl: launcherUrl || 'https://launcher.arcblock.io/',
77
81
  pathname: `/api/launches/${launcherSessionId}`,
78
82
  payload: {},
79
83
  method: 'get',
84
+ locale,
80
85
  });
81
86
  return { error: '', launcherSession: result.launch };
82
87
  } catch (err) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.31-beta-52250475",
6
+ "version": "1.16.31-beta-a0cc72cf",
7
7
  "description": "Simple lib to manage auth in ABT Node",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -20,22 +20,22 @@
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.31-beta-52250475",
24
- "@abtnode/logger": "1.16.31-beta-52250475",
25
- "@abtnode/util": "1.16.31-beta-52250475",
26
- "@arcblock/did": "1.18.132",
27
- "@arcblock/jwt": "^1.18.132",
28
- "@arcblock/nft-display": "^2.10.23",
29
- "@arcblock/validator": "^1.18.132",
30
- "@arcblock/vc": "1.18.132",
31
- "@blocklet/constant": "1.16.31-beta-52250475",
32
- "@blocklet/meta": "1.16.31-beta-52250475",
33
- "@blocklet/sdk": "1.16.31-beta-52250475",
34
- "@ocap/client": "^1.18.132",
35
- "@ocap/mcrypto": "1.18.132",
36
- "@ocap/util": "1.18.132",
37
- "@ocap/wallet": "1.18.132",
38
- "axios": "^1.7.2",
23
+ "@abtnode/constant": "1.16.31-beta-a0cc72cf",
24
+ "@abtnode/logger": "1.16.31-beta-a0cc72cf",
25
+ "@abtnode/util": "1.16.31-beta-a0cc72cf",
26
+ "@arcblock/did": "1.18.135",
27
+ "@arcblock/jwt": "^1.18.135",
28
+ "@arcblock/nft-display": "^2.10.28",
29
+ "@arcblock/validator": "^1.18.135",
30
+ "@arcblock/vc": "1.18.135",
31
+ "@blocklet/constant": "1.16.31-beta-a0cc72cf",
32
+ "@blocklet/meta": "1.16.31-beta-a0cc72cf",
33
+ "@blocklet/sdk": "1.16.31-beta-a0cc72cf",
34
+ "@ocap/client": "^1.18.135",
35
+ "@ocap/mcrypto": "1.18.135",
36
+ "@ocap/util": "1.18.135",
37
+ "@ocap/wallet": "1.18.135",
38
+ "axios": "^1.7.5",
39
39
  "flat": "^5.0.2",
40
40
  "fs-extra": "^11.2.0",
41
41
  "is-url": "^1.2.4",
@@ -43,12 +43,12 @@
43
43
  "jsonwebtoken": "^9.0.0",
44
44
  "lodash": "^4.17.21",
45
45
  "p-retry": "4.6.1",
46
- "semver": "^7.3.8",
46
+ "semver": "^7.6.3",
47
47
  "transliteration": "^2.3.5",
48
48
  "ufo": "^1.5.3"
49
49
  },
50
50
  "devDependencies": {
51
51
  "jest": "^29.7.0"
52
52
  },
53
- "gitHead": "26155b86f103f9e64fd8a23b7fffdb279c71209c"
53
+ "gitHead": "d1eec814979a4086fc5efd7c719687b76c972ec6"
54
54
  }