@tachybase/plugin-auth-wechat 1.3.22 → 1.3.24
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
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"react": "18.3.1",
|
|
3
|
-
"@tachybase/client": "1.3.
|
|
3
|
+
"@tachybase/client": "1.3.24",
|
|
4
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.24",
|
|
7
|
+
"@tachybase/schema": "1.3.49",
|
|
8
8
|
"react-router-dom": "6.28.1",
|
|
9
9
|
"react-i18next": "15.2.0",
|
|
10
|
-
"@tego/server": "1.3.
|
|
10
|
+
"@tego/server": "1.3.49",
|
|
11
|
+
"dayjs": "1.11.13"
|
|
11
12
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
18
|
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
var redirect_exports = {};
|
|
19
29
|
__export(redirect_exports, {
|
|
@@ -21,6 +31,7 @@ __export(redirect_exports, {
|
|
|
21
31
|
});
|
|
22
32
|
module.exports = __toCommonJS(redirect_exports);
|
|
23
33
|
var import_server = require("@tego/server");
|
|
34
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
24
35
|
var import_constants = require("../../constants");
|
|
25
36
|
const redirect = async (ctx, next) => {
|
|
26
37
|
let { state } = ctx.request.query;
|
|
@@ -57,7 +68,7 @@ const redirect = async (ctx, next) => {
|
|
|
57
68
|
}
|
|
58
69
|
const ts = search.get("ts") ? +search.get("ts") : 0;
|
|
59
70
|
if (ts) {
|
|
60
|
-
if (ts < (0,
|
|
71
|
+
if (ts < (0, import_dayjs.default)().subtract(import_constants.AUTH_TIMEOUT_MINUTE, "minute").unix()) {
|
|
61
72
|
ctx.throw(400, "timeout");
|
|
62
73
|
}
|
|
63
74
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
18
|
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
var wechat_auth_exports = {};
|
|
19
29
|
__export(wechat_auth_exports, {
|
|
@@ -22,6 +32,7 @@ __export(wechat_auth_exports, {
|
|
|
22
32
|
});
|
|
23
33
|
module.exports = __toCommonJS(wechat_auth_exports);
|
|
24
34
|
var import_server = require("@tego/server");
|
|
35
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
25
36
|
var import_constants = require("../constants");
|
|
26
37
|
var import_server2 = require("@tego/server");
|
|
27
38
|
class WeChatAuth extends import_server.BaseAuth {
|
|
@@ -119,7 +130,7 @@ class WeChatAuth extends import_server.BaseAuth {
|
|
|
119
130
|
}
|
|
120
131
|
const state = encodeURIComponent(
|
|
121
132
|
encodeURIComponent(
|
|
122
|
-
`redirect=${redirect}&app=${app}&name=${this.ctx.headers["x-authenticator"]}&ts=${(0,
|
|
133
|
+
`redirect=${redirect}&app=${app}&name=${this.ctx.headers["x-authenticator"]}&ts=${(0, import_dayjs.default)().unix()}`
|
|
123
134
|
)
|
|
124
135
|
);
|
|
125
136
|
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.24",
|
|
5
5
|
"description": "WeChat authentication.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Authentication"
|
|
@@ -11,14 +11,15 @@
|
|
|
11
11
|
"dependencies": {},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@ant-design/icons": "^5.6.1",
|
|
14
|
-
"@tachybase/schema": "^1.3.
|
|
15
|
-
"@tego/client": "^1.3.
|
|
16
|
-
"@tego/server": "^1.3.
|
|
14
|
+
"@tachybase/schema": "^1.3.49",
|
|
15
|
+
"@tego/client": "^1.3.49",
|
|
16
|
+
"@tego/server": "^1.3.49",
|
|
17
17
|
"antd": "5.22.5",
|
|
18
|
+
"dayjs": "^1.11.13",
|
|
18
19
|
"react-i18next": "15.2.0",
|
|
19
20
|
"react-router-dom": "6.28.1",
|
|
20
|
-
"@tachybase/client": "1.3.
|
|
21
|
-
"@tachybase/module-auth": "1.3.
|
|
21
|
+
"@tachybase/client": "1.3.24",
|
|
22
|
+
"@tachybase/module-auth": "1.3.24"
|
|
22
23
|
},
|
|
23
24
|
"description.zh-CN": "通过微信扫码认证身份。",
|
|
24
25
|
"displayName.zh-CN": "认证:微信",
|