@tachybase/plugin-auth-sms 1.6.0 → 1.6.3

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,10 +1,10 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "1.6.0",
4
- "@tachybase/module-auth": "1.6.0",
5
- "@tachybase/schema": "1.3.52",
3
+ "@tachybase/client": "1.6.3",
4
+ "@tachybase/module-auth": "1.6.3",
5
+ "@tachybase/schema": "1.6.1",
6
6
  "antd": "5.22.5",
7
- "@tachybase/plugin-otp": "1.6.0",
8
- "@tego/server": "1.3.52",
7
+ "@tego/server": "1.6.1",
8
+ "@tachybase/plugin-otp": "1.6.3",
9
9
  "react-i18next": "16.2.1"
10
10
  };
File without changes
@@ -36,7 +36,7 @@ class SmsAuthPlugin extends import_server.Plugin {
36
36
  plugin: this
37
37
  }
38
38
  });
39
- const verificationPlugin = this.app.getPlugin("otp");
39
+ const verificationPlugin = this.app.pm.get("otp");
40
40
  if (!verificationPlugin) {
41
41
  this.app.logger.warn("sms-auth: @tachybase/plugin-otp is required");
42
42
  return;
@@ -27,12 +27,13 @@ class SMSAuth extends import_server.BaseAuth {
27
27
  const { ctx } = config;
28
28
  super({
29
29
  ...config,
30
- userCollection: ctx.db.getCollection("users")
30
+ userCollection: ctx.db.getCollection("users"),
31
+ userStatusCollection: ctx.db.getCollection("userStatuses")
31
32
  });
32
33
  }
33
34
  async validate() {
34
35
  const ctx = this.ctx;
35
- const verificationPlugin = ctx.app.getPlugin("otp");
36
+ const verificationPlugin = ctx.tego.getPlugin("otp");
36
37
  if (!verificationPlugin) {
37
38
  throw new Error("sms-auth: @tachybase/plugin-otp is required");
38
39
  }
@@ -79,7 +80,7 @@ class SMSAuth extends import_server.BaseAuth {
79
80
  const {
80
81
  values: { newPassword, phone, oldPassword, code }
81
82
  } = ctx.action.params;
82
- const verificationPlugin = ctx.app.getPlugin("otp");
83
+ const verificationPlugin = ctx.tego.getPlugin("otp");
83
84
  const currentUser = ctx.auth.user;
84
85
  if (!currentUser) {
85
86
  ctx.throw(401);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tachybase/plugin-auth-sms",
3
3
  "displayName": "Auth: SMS",
4
- "version": "1.6.0",
4
+ "version": "1.6.3",
5
5
  "description": "SMS authentication.",
6
6
  "keywords": [
7
7
  "Authentication"
@@ -10,16 +10,16 @@
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.1",
14
+ "@tachybase/test": "1.6.1",
15
+ "@tego/client": "1.6.1",
16
+ "@tego/server": "1.6.1",
17
17
  "antd": "5.22.5",
18
18
  "react": "18.3.1",
19
19
  "react-i18next": "16.2.1",
20
- "@tachybase/client": "1.6.0",
21
- "@tachybase/module-auth": "1.6.0",
22
- "@tachybase/plugin-otp": "1.6.0"
20
+ "@tachybase/client": "1.6.3",
21
+ "@tachybase/plugin-otp": "1.6.3",
22
+ "@tachybase/module-auth": "1.6.3"
23
23
  },
24
24
  "description.zh-CN": "通过短信验证码认证身份。",
25
25
  "displayName.zh-CN": "认证:短信",