@tachybase/auth 1.3.52 → 1.3.53

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.
@@ -88,7 +88,7 @@ const _AuthManager = class _AuthManager {
88
88
  const name = ctx.get(self.options.authKey) || self.options.default;
89
89
  let authenticator;
90
90
  try {
91
- authenticator = await ctx.app.authManager.get(name, ctx);
91
+ authenticator = await ctx.tego.authManager.get(name, ctx);
92
92
  ctx.auth = authenticator;
93
93
  } catch (err) {
94
94
  ctx.auth = {};
package/lib/auth.js CHANGED
@@ -50,7 +50,7 @@ const _Auth = class _Auth {
50
50
  }
51
51
  async skipCheck() {
52
52
  const token = this.ctx.getBearerToken();
53
- if (!token && this.ctx.app.options.acl === false) {
53
+ if (!token && this.ctx.tego.options.acl === false) {
54
54
  return true;
55
55
  }
56
56
  const { resourceName, actionName } = this.ctx.action;
package/lib/base/auth.js CHANGED
@@ -44,10 +44,10 @@ const _BaseAuth = class _BaseAuth extends import_auth.Auth {
44
44
  return this.userCollection.repository;
45
45
  }
46
46
  get jwt() {
47
- return this.ctx.app.authManager.jwt;
47
+ return this.ctx.tego.authManager.jwt;
48
48
  }
49
49
  get tokenController() {
50
- return this.ctx.app.authManager.tokenController;
50
+ return this.ctx.tego.authManager.tokenController;
51
51
  }
52
52
  set user(user) {
53
53
  this.ctx.state.currentUser = user;
@@ -88,7 +88,7 @@ const _BaseAuth = class _BaseAuth extends import_auth.Auth {
88
88
  }
89
89
  }
90
90
  const { userId, roleName, iat, temp, jti, exp, signInTime } = payload ?? {};
91
- const user = userId ? await this.ctx.app.cache.wrap(
91
+ const user = userId ? await this.ctx.tego.cache.wrap(
92
92
  this.getCacheKey(userId),
93
93
  () => this.userRepository.findOne({
94
94
  filter: {
@@ -274,7 +274,7 @@ const _BaseAuth = class _BaseAuth extends import_auth.Auth {
274
274
  });
275
275
  }
276
276
  }
277
- await this.ctx.app.emitAsync("cache:del:roles", { userId });
277
+ await this.ctx.tego.emitAsync("cache:del:roles", { userId });
278
278
  await this.ctx.cache.del(this.getCacheKey(userId));
279
279
  return await this.jwt.block(token);
280
280
  }
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@tachybase/auth",
3
- "version": "1.3.52",
3
+ "version": "1.3.53",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./lib/index.js",
7
7
  "types": "./lib/index.d.ts",
8
8
  "dependencies": {
9
9
  "jsonwebtoken": "^8.5.1",
10
- "@tachybase/actions": "1.3.52",
11
- "@tachybase/database": "1.3.52",
12
- "@tachybase/resourcer": "1.3.52",
13
- "@tachybase/utils": "1.3.52"
10
+ "@tachybase/actions": "1.3.53",
11
+ "@tachybase/database": "1.3.53",
12
+ "@tachybase/resourcer": "1.3.53",
13
+ "@tachybase/utils": "1.3.53"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@types/jsonwebtoken": "^8.5.9",