@nocobase/plugin-auth 2.1.0-alpha.40 → 2.1.0-alpha.45

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.
@@ -26,14 +26,16 @@ export declare class TokenController implements TokenControlService {
26
26
  getConfig(): Promise<NumericTokenPolicyConfig>;
27
27
  setConfig(config: TokenPolicyConfig): Promise<void>;
28
28
  removeSessionExpiredTokens(userId: number): Promise<number>;
29
- add({ userId }: {
29
+ add({ userId, authenticator }: {
30
30
  userId: number;
31
+ authenticator?: string;
31
32
  }): Promise<{
32
33
  jti: `${string}-${string}-${string}-${string}-${string}`;
33
34
  issuedTime: number;
34
35
  signInTime: number;
35
36
  renewed: boolean;
36
37
  userId: number;
38
+ authenticator: string;
37
39
  }>;
38
40
  renew: TokenControlService['renew'];
39
41
  }
@@ -93,7 +93,7 @@ class TokenController {
93
93
  }
94
94
  });
95
95
  }
96
- async add({ userId }) {
96
+ async add({ userId, authenticator }) {
97
97
  const jti = (0, import_crypto.randomUUID)();
98
98
  const currTS = Date.now();
99
99
  const data = {
@@ -101,7 +101,8 @@ class TokenController {
101
101
  issuedTime: currTS,
102
102
  signInTime: currTS,
103
103
  renewed: false,
104
- userId
104
+ userId,
105
+ authenticator
105
106
  };
106
107
  await this.setTokenInfo(jti, data);
107
108
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-auth",
3
- "version": "2.1.0-alpha.40",
3
+ "version": "2.1.0-alpha.45",
4
4
  "main": "./dist/server/index.js",
5
5
  "homepage": "https://docs.nocobase.com/handbook/auth",
6
6
  "homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/auth",
@@ -31,7 +31,7 @@
31
31
  "description": "User authentication management, including password, SMS, and support for Single Sign-On (SSO) protocols, with extensibility.",
32
32
  "description.ru-RU": "Управление аутентификацией пользователей: пароли, SMS, поддержка протоколов единого входа (SSO) и возможность расширения.",
33
33
  "description.zh-CN": "用户认证管理,包括基础的密码认证、短信认证、SSO 协议的认证等,可扩展。",
34
- "gitHead": "e73f99dd0abefe847f2e50ff0fea1f41a82fd048",
34
+ "gitHead": "e9e24987e12d0ad10a5db8815b1e1b7b447f1938",
35
35
  "keywords": [
36
36
  "Authentication",
37
37
  "Security"