@nocobase/auth 0.21.0-alpha.1 → 0.21.0-alpha.2

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.
@@ -21,6 +21,9 @@ type AuthConfig = {
21
21
  title?: string;
22
22
  };
23
23
  export declare class AuthManager {
24
+ /**
25
+ * @internal
26
+ */
24
27
  jwt: JwtService;
25
28
  protected options: AuthManagerOptions;
26
29
  protected authTypes: Registry<AuthConfig>;
@@ -24,6 +24,9 @@ module.exports = __toCommonJS(auth_manager_exports);
24
24
  var import_utils = require("@nocobase/utils");
25
25
  var import_jwt_service = require("./base/jwt-service");
26
26
  const _AuthManager = class _AuthManager {
27
+ /**
28
+ * @internal
29
+ */
27
30
  jwt;
28
31
  options;
29
32
  authTypes = new import_utils.Registry();
@@ -11,10 +11,19 @@ export declare class BaseAuth extends Auth {
11
11
  userCollection: Collection;
12
12
  });
13
13
  get userRepository(): import("@nocobase/database").Repository<any, any>;
14
+ /**
15
+ * @internal
16
+ */
14
17
  get jwt(): JwtService;
15
18
  set user(user: Model);
16
19
  get user(): Model;
20
+ /**
21
+ * @internal
22
+ */
17
23
  getCacheKey(userId: number): string;
24
+ /**
25
+ * @internal
26
+ */
18
27
  validateUsername(username: string): boolean;
19
28
  check(): Promise<any>;
20
29
  validate(): Promise<Model>;
package/lib/base/auth.js CHANGED
@@ -32,6 +32,9 @@ const _BaseAuth = class _BaseAuth extends import_auth.Auth {
32
32
  get userRepository() {
33
33
  return this.userCollection.repository;
34
34
  }
35
+ /**
36
+ * @internal
37
+ */
35
38
  get jwt() {
36
39
  return this.ctx.app.authManager.jwt;
37
40
  }
@@ -41,9 +44,15 @@ const _BaseAuth = class _BaseAuth extends import_auth.Auth {
41
44
  get user() {
42
45
  return this.ctx.state.currentUser;
43
46
  }
47
+ /**
48
+ * @internal
49
+ */
44
50
  getCacheKey(userId) {
45
51
  return `auth:${userId}`;
46
52
  }
53
+ /**
54
+ * @internal
55
+ */
47
56
  validateUsername(username) {
48
57
  return /^[^@.<>"'/]{2,16}$/.test(username);
49
58
  }
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@nocobase/auth",
3
- "version": "0.21.0-alpha.1",
3
+ "version": "0.21.0-alpha.2",
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
- "@nocobase/actions": "0.21.0-alpha.1",
10
- "@nocobase/cache": "0.21.0-alpha.1",
11
- "@nocobase/database": "0.21.0-alpha.1",
12
- "@nocobase/resourcer": "0.21.0-alpha.1",
13
- "@nocobase/utils": "0.21.0-alpha.1",
9
+ "@nocobase/actions": "0.21.0-alpha.2",
10
+ "@nocobase/cache": "0.21.0-alpha.2",
11
+ "@nocobase/database": "0.21.0-alpha.2",
12
+ "@nocobase/resourcer": "0.21.0-alpha.2",
13
+ "@nocobase/utils": "0.21.0-alpha.2",
14
14
  "@types/jsonwebtoken": "^8.5.8",
15
15
  "jsonwebtoken": "^8.5.1"
16
16
  },
@@ -19,5 +19,5 @@
19
19
  "url": "git+https://github.com/nocobase/nocobase.git",
20
20
  "directory": "packages/auth"
21
21
  },
22
- "gitHead": "afd2f3d1341b85ea9daa7b2667dd4ace1fafb7ff"
22
+ "gitHead": "90628f2e2da846208fb2d7966ddb4e467d187ffb"
23
23
  }