@tachybase/plugin-auth-wechat 1.3.21 → 1.3.23
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 +6 -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 +13 -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 +16 -6
- package/package.json +11 -17
package/dist/externalVersion.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
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.23",
|
|
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.23",
|
|
7
|
+
"@tachybase/schema": "1.3.43",
|
|
8
8
|
"react-router-dom": "6.28.1",
|
|
9
9
|
"react-i18next": "15.2.0",
|
|
10
|
-
"@
|
|
11
|
-
"
|
|
12
|
-
"@tachybase/auth": "1.3.21",
|
|
13
|
-
"@tachybase/utils": "1.3.21"
|
|
10
|
+
"@tego/server": "1.3.43",
|
|
11
|
+
"dayjs": "1.11.13"
|
|
14
12
|
};
|
|
@@ -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>;
|
|
@@ -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,14 +16,22 @@ 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, {
|
|
20
30
|
redirect: () => redirect
|
|
21
31
|
});
|
|
22
32
|
module.exports = __toCommonJS(redirect_exports);
|
|
23
|
-
var import_server = require("@
|
|
24
|
-
var
|
|
33
|
+
var import_server = require("@tego/server");
|
|
34
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
25
35
|
var import_constants = require("../../constants");
|
|
26
36
|
const redirect = async (ctx, next) => {
|
|
27
37
|
let { state } = ctx.request.query;
|
|
@@ -58,7 +68,7 @@ const redirect = async (ctx, next) => {
|
|
|
58
68
|
}
|
|
59
69
|
const ts = search.get("ts") ? +search.get("ts") : 0;
|
|
60
70
|
if (ts) {
|
|
61
|
-
if (ts < (0,
|
|
71
|
+
if (ts < (0, import_dayjs.default)().subtract(import_constants.AUTH_TIMEOUT_MINUTE, "minute").unix()) {
|
|
62
72
|
ctx.throw(400, "timeout");
|
|
63
73
|
}
|
|
64
74
|
}
|
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>;
|
|
@@ -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,18 +16,26 @@ 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, {
|
|
20
|
-
Model: () =>
|
|
30
|
+
Model: () => import_server2.Model,
|
|
21
31
|
WeChatAuth: () => WeChatAuth
|
|
22
32
|
});
|
|
23
33
|
module.exports = __toCommonJS(wechat_auth_exports);
|
|
24
|
-
var
|
|
25
|
-
var
|
|
34
|
+
var import_server = require("@tego/server");
|
|
35
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
26
36
|
var import_constants = require("../constants");
|
|
27
|
-
var
|
|
28
|
-
class WeChatAuth extends
|
|
37
|
+
var import_server2 = require("@tego/server");
|
|
38
|
+
class WeChatAuth extends import_server.BaseAuth {
|
|
29
39
|
constructor(config) {
|
|
30
40
|
const { ctx } = config;
|
|
31
41
|
super({
|
|
@@ -120,7 +130,7 @@ class WeChatAuth extends import_auth.BaseAuth {
|
|
|
120
130
|
}
|
|
121
131
|
const state = encodeURIComponent(
|
|
122
132
|
encodeURIComponent(
|
|
123
|
-
`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()}`
|
|
124
134
|
)
|
|
125
135
|
);
|
|
126
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.23",
|
|
5
5
|
"description": "WeChat authentication.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Authentication"
|
|
@@ -10,24 +10,18 @@
|
|
|
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.43",
|
|
15
|
+
"@tego/client": "^1.3.43",
|
|
16
|
+
"@tego/server": "^1.3.43",
|
|
14
17
|
"antd": "5.22.5",
|
|
15
|
-
"
|
|
16
|
-
"react-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"@tachybase/auth": "1.3.
|
|
20
|
-
"@tachybase/actions": "1.3.21",
|
|
21
|
-
"@tachybase/client": "1.3.21",
|
|
22
|
-
"@tachybase/database": "1.3.21",
|
|
23
|
-
"@tachybase/module-auth": "1.3.21",
|
|
24
|
-
"@tachybase/schema": "1.3.21",
|
|
25
|
-
"@tachybase/server": "1.3.21",
|
|
26
|
-
"@tachybase/utils": "1.3.21"
|
|
18
|
+
"dayjs": "^1.11.13",
|
|
19
|
+
"react-i18next": "15.2.0",
|
|
20
|
+
"react-router-dom": "6.28.1",
|
|
21
|
+
"@tachybase/client": "1.3.23",
|
|
22
|
+
"@tachybase/module-auth": "1.3.23"
|
|
27
23
|
},
|
|
28
24
|
"description.zh-CN": "通过微信扫码认证身份。",
|
|
29
25
|
"displayName.zh-CN": "认证:微信",
|
|
30
|
-
"scripts": {
|
|
31
|
-
"build": "tachybase-build --no-dts @tachybase/plugin-auth-wechat"
|
|
32
|
-
}
|
|
26
|
+
"scripts": {}
|
|
33
27
|
}
|