@tachybase/plugin-auth-wechat 1.3.20 → 1.3.22
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/externalVersion.js +5 -8
- package/dist/server/actions/get-auth-cfg.d.ts +1 -1
- package/dist/server/actions/redirect.d.ts +1 -1
- package/dist/server/actions/redirect.js +2 -3
- package/dist/server/plugin.d.ts +1 -1
- package/dist/server/plugin.js +1 -1
- package/dist/server/wechat-auth.d.ts +2 -2
- package/dist/server/wechat-auth.js +5 -6
- package/package.json +10 -17
package/dist/externalVersion.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"react": "18.3.1",
|
|
3
|
-
"@tachybase/client": "1.3.
|
|
4
|
-
"@ant-design/icons": "5.
|
|
3
|
+
"@tachybase/client": "1.3.22",
|
|
4
|
+
"@ant-design/icons": "5.6.1",
|
|
5
5
|
"antd": "5.22.5",
|
|
6
|
-
"@tachybase/module-auth": "1.3.
|
|
7
|
-
"@tachybase/schema": "1.3.
|
|
6
|
+
"@tachybase/module-auth": "1.3.22",
|
|
7
|
+
"@tachybase/schema": "1.3.39",
|
|
8
8
|
"react-router-dom": "6.28.1",
|
|
9
9
|
"react-i18next": "15.2.0",
|
|
10
|
-
"@
|
|
11
|
-
"@tachybase/actions": "1.3.20",
|
|
12
|
-
"@tachybase/auth": "1.3.20",
|
|
13
|
-
"@tachybase/utils": "1.3.20"
|
|
10
|
+
"@tego/server": "1.3.39"
|
|
14
11
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Context, Next } from '@
|
|
1
|
+
import { Context, Next } from '@tego/server';
|
|
2
2
|
export declare const getAuthCfg: (ctx: Context, next: Next) => Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Context, Next } from '@
|
|
1
|
+
import { Context, Next } from '@tego/server';
|
|
2
2
|
export declare const redirect: (ctx: Context, next: Next) => Promise<any>;
|
|
@@ -20,8 +20,7 @@ __export(redirect_exports, {
|
|
|
20
20
|
redirect: () => redirect
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(redirect_exports);
|
|
23
|
-
var import_server = require("@
|
|
24
|
-
var import_utils = require("@tachybase/utils");
|
|
23
|
+
var import_server = require("@tego/server");
|
|
25
24
|
var import_constants = require("../../constants");
|
|
26
25
|
const redirect = async (ctx, next) => {
|
|
27
26
|
let { state } = ctx.request.query;
|
|
@@ -58,7 +57,7 @@ const redirect = async (ctx, next) => {
|
|
|
58
57
|
}
|
|
59
58
|
const ts = search.get("ts") ? +search.get("ts") : 0;
|
|
60
59
|
if (ts) {
|
|
61
|
-
if (ts < (0,
|
|
60
|
+
if (ts < (0, import_server.dayjs)().subtract(import_constants.AUTH_TIMEOUT_MINUTE, "minute").unix()) {
|
|
62
61
|
ctx.throw(400, "timeout");
|
|
63
62
|
}
|
|
64
63
|
}
|
package/dist/server/plugin.d.ts
CHANGED
package/dist/server/plugin.js
CHANGED
|
@@ -21,7 +21,7 @@ __export(plugin_exports, {
|
|
|
21
21
|
default: () => plugin_default
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(plugin_exports);
|
|
24
|
-
var import_server = require("@
|
|
24
|
+
var import_server = require("@tego/server");
|
|
25
25
|
var import_constants = require("../constants");
|
|
26
26
|
var import_actions = require("./actions");
|
|
27
27
|
var import_wechat_auth = require("./wechat-auth");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AuthConfig, BaseAuth } from '@
|
|
2
|
-
export { Model } from '@
|
|
1
|
+
import { AuthConfig, BaseAuth } from '@tego/server';
|
|
2
|
+
export { Model } from '@tego/server';
|
|
3
3
|
export declare class WeChatAuth extends BaseAuth {
|
|
4
4
|
constructor(config: AuthConfig);
|
|
5
5
|
validate(): Promise<any>;
|
|
@@ -17,15 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
var wechat_auth_exports = {};
|
|
19
19
|
__export(wechat_auth_exports, {
|
|
20
|
-
Model: () =>
|
|
20
|
+
Model: () => import_server2.Model,
|
|
21
21
|
WeChatAuth: () => WeChatAuth
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(wechat_auth_exports);
|
|
24
|
-
var
|
|
25
|
-
var import_utils = require("@tachybase/utils");
|
|
24
|
+
var import_server = require("@tego/server");
|
|
26
25
|
var import_constants = require("../constants");
|
|
27
|
-
var
|
|
28
|
-
class WeChatAuth extends
|
|
26
|
+
var import_server2 = require("@tego/server");
|
|
27
|
+
class WeChatAuth extends import_server.BaseAuth {
|
|
29
28
|
constructor(config) {
|
|
30
29
|
const { ctx } = config;
|
|
31
30
|
super({
|
|
@@ -120,7 +119,7 @@ class WeChatAuth extends import_auth.BaseAuth {
|
|
|
120
119
|
}
|
|
121
120
|
const state = encodeURIComponent(
|
|
122
121
|
encodeURIComponent(
|
|
123
|
-
`redirect=${redirect}&app=${app}&name=${this.ctx.headers["x-authenticator"]}&ts=${(0,
|
|
122
|
+
`redirect=${redirect}&app=${app}&name=${this.ctx.headers["x-authenticator"]}&ts=${(0, import_server.dayjs)().unix()}`
|
|
124
123
|
)
|
|
125
124
|
);
|
|
126
125
|
return {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/plugin-auth-wechat",
|
|
3
3
|
"displayName": "Auth: WeChat",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.22",
|
|
5
5
|
"description": "WeChat authentication.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Authentication"
|
|
@@ -10,24 +10,17 @@
|
|
|
10
10
|
"main": "dist/server/index.js",
|
|
11
11
|
"dependencies": {},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@ant-design/icons": "
|
|
13
|
+
"@ant-design/icons": "^5.6.1",
|
|
14
|
+
"@tachybase/schema": "^1.3.39",
|
|
15
|
+
"@tego/client": "^1.3.39",
|
|
16
|
+
"@tego/server": "^1.3.39",
|
|
14
17
|
"antd": "5.22.5",
|
|
15
|
-
"react-i18next": "
|
|
16
|
-
"react-router-dom": "6.28.1"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"@tachybase/auth": "1.3.20",
|
|
20
|
-
"@tachybase/actions": "1.3.20",
|
|
21
|
-
"@tachybase/client": "1.3.20",
|
|
22
|
-
"@tachybase/database": "1.3.20",
|
|
23
|
-
"@tachybase/schema": "1.3.20",
|
|
24
|
-
"@tachybase/server": "1.3.20",
|
|
25
|
-
"@tachybase/module-auth": "1.3.20",
|
|
26
|
-
"@tachybase/utils": "1.3.20"
|
|
18
|
+
"react-i18next": "15.2.0",
|
|
19
|
+
"react-router-dom": "6.28.1",
|
|
20
|
+
"@tachybase/client": "1.3.22",
|
|
21
|
+
"@tachybase/module-auth": "1.3.22"
|
|
27
22
|
},
|
|
28
23
|
"description.zh-CN": "通过微信扫码认证身份。",
|
|
29
24
|
"displayName.zh-CN": "认证:微信",
|
|
30
|
-
"scripts": {
|
|
31
|
-
"build": "tachybase-build --no-dts @tachybase/plugin-auth-wechat"
|
|
32
|
-
}
|
|
25
|
+
"scripts": {}
|
|
33
26
|
}
|