@tachybase/plugin-api-keys 1.5.1 → 1.6.1

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,8 +1,8 @@
1
1
  module.exports = {
2
- "@tachybase/client": "1.5.1",
3
- "@tego/server": "1.3.52",
2
+ "@tachybase/client": "1.6.1",
3
+ "@tego/server": "1.6.0-alpha.9",
4
4
  "react": "18.3.1",
5
- "@tachybase/schema": "1.3.52",
5
+ "@tachybase/schema": "1.6.0-alpha.9",
6
6
  "ahooks": "3.9.0",
7
7
  "antd": "5.22.5",
8
8
  "dayjs": "1.11.13",
@@ -38,7 +38,7 @@ async function create(ctx, next) {
38
38
  throw ctx.throw(400, ctx.t("Role not found"));
39
39
  }
40
40
  const hash = (0, import_node_crypto.createHash)("sha256");
41
- const jwtToken = ctx.app.authManager.jwt.sign(
41
+ const jwtToken = ctx.tego.authManager.jwt.sign(
42
42
  { userId: ctx.auth.user.id, roleName: role.name },
43
43
  { expiresIn: values.expiresIn }
44
44
  );
@@ -63,7 +63,7 @@ async function destroy(ctx, next) {
63
63
  const data = await repo.findById(filterByTk);
64
64
  const token = data == null ? void 0 : data.get("token");
65
65
  if (token) {
66
- await ctx.app.authManager.jwt.block(token);
66
+ await ctx.tego.authManager.jwt.block(token);
67
67
  }
68
68
  return import_server.actions.destroy(ctx, next);
69
69
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tachybase/plugin-api-keys",
3
3
  "displayName": "Auth: API keys",
4
- "version": "1.5.1",
4
+ "version": "1.6.1",
5
5
  "description": "Allows users to use API key to access application's HTTP API",
6
6
  "keywords": [
7
7
  "Authentication"
@@ -10,17 +10,17 @@
10
10
  "main": "./dist/server/index.js",
11
11
  "dependencies": {},
12
12
  "devDependencies": {
13
- "@tachybase/schema": "1.3.52",
14
- "@tachybase/test": "1.3.52",
15
- "@tego/client": "1.3.52",
16
- "@tego/server": "1.3.52",
13
+ "@tachybase/schema": "1.6.0-alpha.9",
14
+ "@tachybase/test": "1.6.0-alpha.9",
15
+ "@tego/client": "1.6.0-alpha.9",
16
+ "@tego/server": "1.6.0-alpha.9",
17
17
  "ahooks": "^3.9.0",
18
18
  "antd": "5.22.5",
19
19
  "dayjs": "1.11.13",
20
20
  "react": "18.3.1",
21
21
  "react-dom": "18.3.1",
22
22
  "react-i18next": "16.2.1",
23
- "@tachybase/client": "1.5.1"
23
+ "@tachybase/client": "1.6.1"
24
24
  },
25
25
  "description.zh-CN": "允许用户使用 API 密钥访问应用的 HTTP API",
26
26
  "displayName.zh-CN": "认证:API 密钥",