@ruiapp/rapid-core 0.8.15 → 0.8.16

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.
package/dist/index.js CHANGED
@@ -6827,11 +6827,18 @@ async function handler$d(plugin, ctx, options) {
6827
6827
  field: "login",
6828
6828
  value: account,
6829
6829
  },
6830
+ {
6831
+ operator: "null",
6832
+ field: "deletedAt",
6833
+ },
6830
6834
  ],
6831
6835
  }, routeContext?.getDbTransactionClient());
6832
6836
  if (!user) {
6833
6837
  throw new Error("用户名或密码错误。");
6834
6838
  }
6839
+ if (user.state !== "enabled") {
6840
+ throw new Error("用户已被禁用,不允许登录。");
6841
+ }
6835
6842
  const isMatch = await bcrypt__default["default"].compare(password, user.password);
6836
6843
  if (!isMatch) {
6837
6844
  throw new Error("用户名或密码错误。");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruiapp/rapid-core",
3
- "version": "0.8.15",
3
+ "version": "0.8.16",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -26,6 +26,10 @@ export async function handler(plugin: RapidPlugin, ctx: ActionHandlerContext, op
26
26
  field: "login",
27
27
  value: account,
28
28
  },
29
+ {
30
+ operator: "null",
31
+ field: "deletedAt",
32
+ },
29
33
  ],
30
34
  },
31
35
  routeContext?.getDbTransactionClient(),
@@ -35,6 +39,10 @@ export async function handler(plugin: RapidPlugin, ctx: ActionHandlerContext, op
35
39
  throw new Error("用户名或密码错误。");
36
40
  }
37
41
 
42
+ if (user.state !== "enabled") {
43
+ throw new Error("用户已被禁用,不允许登录。");
44
+ }
45
+
38
46
  const isMatch = await bcrypt.compare(password, user.password);
39
47
  if (!isMatch) {
40
48
  throw new Error("用户名或密码错误。");