@blocklet/sdk 1.6.22-beta → 1.6.23

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.
@@ -28,16 +28,14 @@ class WalletAuthenticator extends Authenticator {
28
28
  const info = await closure(options.appInfo)(...args);
29
29
 
30
30
  const { request, baseUrl } = args[0];
31
- const rootPath = '/';
32
- const pathPrefix = request.headers['x-path-prefix'] || rootPath;
33
- const groupPathPrefix = request.headers['x-group-path-prefix'] || rootPath;
31
+ const pathPrefix = request.headers['x-path-prefix'] || '/';
32
+ const groupPathPrefix = request.headers['x-group-path-prefix'] || '/';
34
33
  const blockletDid = request.headers['x-blocklet-did'];
35
34
 
35
+ // Child blocklets should set appInfo.link to exactly the same path as the root blocklet
36
36
  let appUrl = baseUrl;
37
- let subscriptionPath = joinUrl(groupPathPrefix, AUTH_SERVICE_PREFIX, 'websocket');
38
- if (env.isComponent && pathPrefix !== rootPath) {
39
- appUrl = joinUrl(appUrl, rootPath).replace(pathPrefix, rootPath);
40
- subscriptionPath = joinUrl(pathPrefix, subscriptionPath);
37
+ if (env.isComponent && pathPrefix !== groupPathPrefix) {
38
+ appUrl = joinUrl(joinUrl(appUrl, '/').replace(pathPrefix, groupPathPrefix), '');
41
39
  }
42
40
 
43
41
  return {
@@ -47,7 +45,7 @@ class WalletAuthenticator extends Authenticator {
47
45
  link: appUrl,
48
46
  icon: joinUrl(baseUrl, AUTH_SERVICE_PREFIX, `/blocklet/logo/${blockletDid}`),
49
47
  updateSubEndpoint: true,
50
- subscriptionEndpoint: subscriptionPath,
48
+ subscriptionEndpoint: joinUrl(groupPathPrefix, AUTH_SERVICE_PREFIX, 'websocket'),
51
49
  nodeDid: process.env.ABT_NODE_DID,
52
50
  };
53
51
  },
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.6.22-beta",
6
+ "version": "1.6.23",
7
7
  "description": "graphql client to read/write data on abt node",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -19,15 +19,15 @@
19
19
  "author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@abtnode/client": "1.6.22",
23
- "@abtnode/constant": "1.6.22",
24
- "@arcblock/did-auth": "^1.14.17",
25
- "@arcblock/jwt": "^1.14.17",
26
- "@arcblock/ws": "^1.14.17",
27
- "@blocklet/meta": "1.6.22",
22
+ "@abtnode/client": "1.6.23",
23
+ "@abtnode/constant": "1.6.23",
24
+ "@arcblock/did-auth": "^1.14.19",
25
+ "@arcblock/jwt": "^1.14.19",
26
+ "@arcblock/ws": "^1.14.19",
27
+ "@blocklet/meta": "1.6.23",
28
28
  "@nedb/core": "^1.2.2",
29
- "@ocap/mcrypto": "^1.14.17",
30
- "@ocap/wallet": "^1.14.17",
29
+ "@ocap/mcrypto": "^1.14.19",
30
+ "@ocap/wallet": "^1.14.19",
31
31
  "axios": "^0.25.0",
32
32
  "fs-extra": "^10.0.0",
33
33
  "joi": "^17.6.0",
@@ -38,5 +38,6 @@
38
38
  "devDependencies": {
39
39
  "detect-port": "^1.3.0",
40
40
  "jest": "^27.4.5"
41
- }
41
+ },
42
+ "gitHead": "6c478fb7e2a30b302981b5339f349c69134e022e"
42
43
  }