@blocklet/sdk 1.16.47-beta-20250714-035905-f63c5239 → 1.16.47-beta-20250715-034905-11207b15

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.
@@ -1,5 +1,9 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  const get_token_from_req_1 = require("@abtnode/util/lib/get-token-from-req");
6
+ const service_api_1 = __importDefault(require("../util/service-api"));
3
7
  const login_1 = require("../util/login");
4
8
  const verify_session_1 = require("../util/verify-session");
5
9
  const sessionMiddleware = (options = {}) => {
@@ -18,10 +22,20 @@ const sessionMiddleware = (options = {}) => {
18
22
  res.status(400).send('Access token found in multiple locations');
19
23
  return;
20
24
  }
25
+ if (process.env.NODE_ENV !== 'test') {
26
+ const { data: checkResult } = await service_api_1.default.post('/api/user/checkToken', {
27
+ token: loginTokenValue,
28
+ });
29
+ if (!checkResult.valid) {
30
+ res.status(401).send('Access token is blocked');
31
+ return;
32
+ }
33
+ }
34
+ // TODO: 检查 login_token 是否在黑名单中
21
35
  if ((0, login_1.isLoginToken)(loginTokenValue)) {
22
36
  result = await (0, verify_session_1.verifyLoginToken)({ token: loginTokenValue, strictMode });
23
37
  }
24
- if ((0, login_1.isAccessKey)(loginTokenValue) && accessKey) {
38
+ else if ((0, login_1.isAccessKey)(loginTokenValue) && accessKey) {
25
39
  result = await (0, verify_session_1.verifyAccessKey)({ token: loginTokenValue, strictMode });
26
40
  }
27
41
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.47-beta-20250714-035905-f63c5239",
6
+ "version": "1.16.47-beta-20250715-034905-11207b15",
7
7
  "description": "graphql client to read/write data on abt node",
8
8
  "main": "lib/index.js",
9
9
  "typings": "lib/index.d.ts",
@@ -27,25 +27,25 @@
27
27
  "author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
28
28
  "license": "Apache-2.0",
29
29
  "dependencies": {
30
- "@abtnode/client": "1.16.47-beta-20250714-035905-f63c5239",
31
- "@abtnode/constant": "1.16.47-beta-20250714-035905-f63c5239",
32
- "@abtnode/db-cache": "1.16.47-beta-20250714-035905-f63c5239",
33
- "@abtnode/util": "1.16.47-beta-20250714-035905-f63c5239",
34
- "@arcblock/did": "1.20.15",
35
- "@arcblock/did-auth": "1.20.15",
36
- "@arcblock/jwt": "1.20.15",
37
- "@arcblock/ws": "1.20.15",
38
- "@blocklet/constant": "1.16.47-beta-20250714-035905-f63c5239",
39
- "@blocklet/env": "1.16.47-beta-20250714-035905-f63c5239",
30
+ "@abtnode/client": "1.16.47-beta-20250715-034905-11207b15",
31
+ "@abtnode/constant": "1.16.47-beta-20250715-034905-11207b15",
32
+ "@abtnode/db-cache": "1.16.47-beta-20250715-034905-11207b15",
33
+ "@abtnode/util": "1.16.47-beta-20250715-034905-11207b15",
34
+ "@arcblock/did": "1.20.16",
35
+ "@arcblock/did-auth": "1.20.16",
36
+ "@arcblock/jwt": "1.20.16",
37
+ "@arcblock/ws": "1.20.16",
38
+ "@blocklet/constant": "1.16.47-beta-20250715-034905-11207b15",
39
+ "@blocklet/env": "1.16.47-beta-20250715-034905-11207b15",
40
40
  "@blocklet/error": "^0.2.5",
41
- "@blocklet/meta": "1.16.47-beta-20250714-035905-f63c5239",
41
+ "@blocklet/meta": "1.16.47-beta-20250715-034905-11207b15",
42
42
  "@blocklet/theme": "^3.0.26",
43
43
  "@did-connect/authenticator": "^2.2.8",
44
44
  "@did-connect/handler": "^2.2.8",
45
45
  "@nedb/core": "^2.1.5",
46
- "@ocap/mcrypto": "1.20.15",
47
- "@ocap/util": "1.20.15",
48
- "@ocap/wallet": "1.20.15",
46
+ "@ocap/mcrypto": "1.20.16",
47
+ "@ocap/util": "1.20.16",
48
+ "@ocap/wallet": "1.20.16",
49
49
  "axios": "^1.7.9",
50
50
  "cheerio": "1.0.0-rc.12",
51
51
  "debug": "^4.4.1",
@@ -85,5 +85,5 @@
85
85
  "ts-node": "^10.9.1",
86
86
  "typescript": "^5.6.3"
87
87
  },
88
- "gitHead": "a43d1ab1a83ffd0b0bd0a152679050f946837366"
88
+ "gitHead": "f08ee3ac63c808c93967db43445042b3050a015e"
89
89
  }