@nocobase/plugin-auth 1.2.12-alpha → 1.3.0-alpha.20240710084543
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/package.json +2 -2
- package/dist/client/AuthProvider.d.ts +0 -10
- package/dist/client/authenticator.d.ts +0 -21
- package/dist/client/basic/Options.d.ts +0 -10
- package/dist/client/basic/SignInForm.d.ts +0 -17
- package/dist/client/basic/SignUpForm.d.ts +0 -21
- package/dist/client/basic/index.d.ts +0 -11
- package/dist/client/index.d.ts +0 -35
- package/dist/client/index.js +0 -31
- package/dist/client/locale/index.d.ts +0 -10
- package/dist/client/pages/AuthLayout.d.ts +0 -13
- package/dist/client/pages/SignInPage.d.ts +0 -24
- package/dist/client/pages/SignUpPage.d.ts +0 -29
- package/dist/client/pages/index.d.ts +0 -11
- package/dist/client/settings/Authenticator.d.ts +0 -10
- package/dist/client/settings/Options.d.ts +0 -12
- package/dist/client/settings/authType.d.ts +0 -24
- package/dist/client/settings/schemas/authenticators.d.ts +0 -11
- package/dist/externalVersion.js +0 -27
- package/dist/index.d.ts +0 -9
- package/dist/index.js +0 -49
- package/dist/locale/en-US.json +0 -27
- package/dist/locale/ko_KR.json +0 -26
- package/dist/locale/zh-CN.json +0 -27
- package/dist/node_modules/cron/LICENSE +0 -8
- package/dist/node_modules/cron/lib/cron.js +0 -1
- package/dist/node_modules/cron/lib/job.js +0 -215
- package/dist/node_modules/cron/lib/time.js +0 -830
- package/dist/node_modules/cron/node_modules/luxon/build/amd/luxon.js +0 -7826
- package/dist/node_modules/cron/node_modules/luxon/build/cjs-browser/luxon.js +0 -7824
- package/dist/node_modules/cron/node_modules/luxon/build/es6/luxon.js +0 -7217
- package/dist/node_modules/cron/node_modules/luxon/build/global/luxon.js +0 -7829
- package/dist/node_modules/cron/node_modules/luxon/build/global/luxon.min.js +0 -1
- package/dist/node_modules/cron/node_modules/luxon/build/node/luxon.js +0 -6932
- package/dist/node_modules/cron/node_modules/luxon/package.json +0 -85
- package/dist/node_modules/cron/node_modules/luxon/src/datetime.js +0 -2248
- package/dist/node_modules/cron/node_modules/luxon/src/duration.js +0 -948
- package/dist/node_modules/cron/node_modules/luxon/src/errors.js +0 -61
- package/dist/node_modules/cron/node_modules/luxon/src/impl/conversions.js +0 -161
- package/dist/node_modules/cron/node_modules/luxon/src/impl/diff.js +0 -75
- package/dist/node_modules/cron/node_modules/luxon/src/impl/digits.js +0 -75
- package/dist/node_modules/cron/node_modules/luxon/src/impl/english.js +0 -233
- package/dist/node_modules/cron/node_modules/luxon/src/impl/formats.js +0 -176
- package/dist/node_modules/cron/node_modules/luxon/src/impl/formatter.js +0 -400
- package/dist/node_modules/cron/node_modules/luxon/src/impl/invalid.js +0 -14
- package/dist/node_modules/cron/node_modules/luxon/src/impl/locale.js +0 -494
- package/dist/node_modules/cron/node_modules/luxon/src/impl/regexParser.js +0 -335
- package/dist/node_modules/cron/node_modules/luxon/src/impl/tokenParser.js +0 -444
- package/dist/node_modules/cron/node_modules/luxon/src/impl/util.js +0 -274
- package/dist/node_modules/cron/node_modules/luxon/src/impl/zoneUtil.js +0 -34
- package/dist/node_modules/cron/node_modules/luxon/src/info.js +0 -169
- package/dist/node_modules/cron/node_modules/luxon/src/interval.js +0 -637
- package/dist/node_modules/cron/node_modules/luxon/src/luxon.js +0 -26
- package/dist/node_modules/cron/node_modules/luxon/src/package.json +0 -4
- package/dist/node_modules/cron/node_modules/luxon/src/settings.js +0 -148
- package/dist/node_modules/cron/node_modules/luxon/src/zone.js +0 -91
- package/dist/node_modules/cron/node_modules/luxon/src/zones/IANAZone.js +0 -189
- package/dist/node_modules/cron/node_modules/luxon/src/zones/fixedOffsetZone.js +0 -102
- package/dist/node_modules/cron/node_modules/luxon/src/zones/invalidZone.js +0 -53
- package/dist/node_modules/cron/node_modules/luxon/src/zones/systemZone.js +0 -61
- package/dist/node_modules/cron/package.json +0 -1
- package/dist/node_modules/cron/types/index.d.ts +0 -181
- package/dist/node_modules/cron/types/index.test-d.ts +0 -85
- package/dist/preset.d.ts +0 -11
- package/dist/preset.js +0 -43
- package/dist/server/actions/auth.d.ts +0 -16
- package/dist/server/actions/auth.js +0 -50
- package/dist/server/actions/authenticators.d.ts +0 -16
- package/dist/server/actions/authenticators.js +0 -112
- package/dist/server/basic-auth.d.ts +0 -18
- package/dist/server/basic-auth.js +0 -192
- package/dist/server/collections/authenticators.d.ts +0 -13
- package/dist/server/collections/authenticators.js +0 -126
- package/dist/server/collections/token-blacklist.d.ts +0 -10
- package/dist/server/collections/token-blacklist.js +0 -51
- package/dist/server/collections/users-authenticators.d.ts +0 -14
- package/dist/server/collections/users-authenticators.js +0 -94
- package/dist/server/index.d.ts +0 -11
- package/dist/server/index.js +0 -51
- package/dist/server/locale/en-US.d.ts +0 -17
- package/dist/server/locale/en-US.js +0 -39
- package/dist/server/locale/fr-FR.d.ts +0 -17
- package/dist/server/locale/fr-FR.js +0 -39
- package/dist/server/locale/index.d.ts +0 -11
- package/dist/server/locale/index.js +0 -52
- package/dist/server/locale/ja-JP.d.ts +0 -13
- package/dist/server/locale/ja-JP.js +0 -35
- package/dist/server/locale/pt-BR.d.ts +0 -17
- package/dist/server/locale/pt-BR.js +0 -39
- package/dist/server/locale/zh-CN.d.ts +0 -19
- package/dist/server/locale/zh-CN.js +0 -41
- package/dist/server/migrations/20230506152253-basic-authenticator.d.ts +0 -14
- package/dist/server/migrations/20230506152253-basic-authenticator.js +0 -53
- package/dist/server/migrations/20230607174500-update-basic.d.ts +0 -14
- package/dist/server/migrations/20230607174500-update-basic.js +0 -56
- package/dist/server/migrations/20231218132032-fix-allow-signup.d.ts +0 -14
- package/dist/server/migrations/20231218132032-fix-allow-signup.js +0 -64
- package/dist/server/model/authenticator.d.ts +0 -17
- package/dist/server/model/authenticator.js +0 -78
- package/dist/server/plugin.d.ts +0 -19
- package/dist/server/plugin.js +0 -138
- package/dist/server/storer.d.ts +0 -24
- package/dist/server/storer.js +0 -78
- package/dist/server/token-blacklist.d.ts +0 -25
- package/dist/server/token-blacklist.js +0 -95
- package/dist/swagger/index.d.ts +0 -762
- package/dist/swagger/index.js +0 -796
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export { default as enUS } from './en-US';
|
|
10
|
-
export { default as zhCN } from './zh-CN';
|
|
11
|
-
export { default as ptBR } from './pt-BR';
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __export = (target, all) => {
|
|
17
|
-
for (var name in all)
|
|
18
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
-
for (let key of __getOwnPropNames(from))
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
-
mod
|
|
35
|
-
));
|
|
36
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
-
var locale_exports = {};
|
|
38
|
-
__export(locale_exports, {
|
|
39
|
-
enUS: () => import_en_US.default,
|
|
40
|
-
ptBR: () => import_pt_BR.default,
|
|
41
|
-
zhCN: () => import_zh_CN.default
|
|
42
|
-
});
|
|
43
|
-
module.exports = __toCommonJS(locale_exports);
|
|
44
|
-
var import_en_US = __toESM(require("./en-US"));
|
|
45
|
-
var import_zh_CN = __toESM(require("./zh-CN"));
|
|
46
|
-
var import_pt_BR = __toESM(require("./pt-BR"));
|
|
47
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
-
0 && (module.exports = {
|
|
49
|
-
enUS,
|
|
50
|
-
ptBR,
|
|
51
|
-
zhCN
|
|
52
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
declare const _default: {
|
|
10
|
-
'Please fill in your email address': string;
|
|
11
|
-
'The password is incorrect, please re-enter': string;
|
|
12
|
-
};
|
|
13
|
-
export default _default;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var ja_JP_exports = {};
|
|
28
|
-
__export(ja_JP_exports, {
|
|
29
|
-
default: () => ja_JP_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(ja_JP_exports);
|
|
32
|
-
var ja_JP_default = {
|
|
33
|
-
"Please fill in your email address": "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
34
|
-
"The password is incorrect, please re-enter": "\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002\u518D\u5EA6\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
|
|
35
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
declare const _default: {
|
|
10
|
-
'The email is incorrect, please re-enter': string;
|
|
11
|
-
'Please fill in your email address': string;
|
|
12
|
-
'The password is incorrect, please re-enter': string;
|
|
13
|
-
'Not a valid cellphone number, please re-enter': string;
|
|
14
|
-
'The phone number has been registered, please login directly': string;
|
|
15
|
-
'The phone number is not registered, please register first': string;
|
|
16
|
-
};
|
|
17
|
-
export default _default;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var pt_BR_exports = {};
|
|
28
|
-
__export(pt_BR_exports, {
|
|
29
|
-
default: () => pt_BR_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(pt_BR_exports);
|
|
32
|
-
var pt_BR_default = {
|
|
33
|
-
"The email is incorrect, please re-enter": "O e-mail est\xE1 incorreto, por favor, digite novamente",
|
|
34
|
-
"Please fill in your email address": "Por favor, preencha o seu endere\xE7o de e-mail",
|
|
35
|
-
"The password is incorrect, please re-enter": "A senha est\xE1 incorreta, por favor, digite novamente",
|
|
36
|
-
"Not a valid cellphone number, please re-enter": "N\xFAmero de celular inv\xE1lido, por favor, digite novamente",
|
|
37
|
-
"The phone number has been registered, please login directly": "O n\xFAmero de celular j\xE1 est\xE1 registrado, por favor, fa\xE7a login diretamente",
|
|
38
|
-
"The phone number is not registered, please register first": "O n\xFAmero de celular n\xE3o est\xE1 registrado, por favor, registre-se primeiro"
|
|
39
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
declare const _default: {
|
|
10
|
-
'The username or email is incorrect, please re-enter': string;
|
|
11
|
-
'The password is incorrect, please re-enter': string;
|
|
12
|
-
'Not a valid cellphone number, please re-enter': string;
|
|
13
|
-
'The phone number has been registered, please login directly': string;
|
|
14
|
-
'The phone number is not registered, please register first': string;
|
|
15
|
-
'Please keep and enable at least one authenticator': string;
|
|
16
|
-
'Please enter your username or email': string;
|
|
17
|
-
'Please enter a valid username': string;
|
|
18
|
-
};
|
|
19
|
-
export default _default;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var zh_CN_exports = {};
|
|
28
|
-
__export(zh_CN_exports, {
|
|
29
|
-
default: () => zh_CN_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(zh_CN_exports);
|
|
32
|
-
var zh_CN_default = {
|
|
33
|
-
"The username or email is incorrect, please re-enter": "\u7528\u6237\u540D\u6216\u90AE\u7BB1\u6709\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165",
|
|
34
|
-
"The password is incorrect, please re-enter": "\u5BC6\u7801\u6709\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165",
|
|
35
|
-
"Not a valid cellphone number, please re-enter": "\u4E0D\u662F\u6709\u6548\u7684\u624B\u673A\u53F7\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165",
|
|
36
|
-
"The phone number has been registered, please login directly": "\u624B\u673A\u53F7\u5DF2\u6CE8\u518C\uFF0C\u8BF7\u76F4\u63A5\u767B\u5F55",
|
|
37
|
-
"The phone number is not registered, please register first": "\u624B\u673A\u53F7\u672A\u6CE8\u518C\uFF0C\u8BF7\u5148\u6CE8\u518C",
|
|
38
|
-
"Please keep and enable at least one authenticator": "\u8BF7\u81F3\u5C11\u4FDD\u7559\u5E76\u542F\u7528\u4E00\u4E2A\u8BA4\u8BC1\u5668",
|
|
39
|
-
"Please enter your username or email": "\u8BF7\u8F93\u5165\u7528\u6237\u540D\u6216\u90AE\u7BB1",
|
|
40
|
-
"Please enter a valid username": "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u7528\u6237\u540D"
|
|
41
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { Migration } from '@nocobase/server';
|
|
10
|
-
export default class AddBasicAuthMigration extends Migration {
|
|
11
|
-
appVersion: string;
|
|
12
|
-
up(): Promise<void>;
|
|
13
|
-
down(): Promise<void>;
|
|
14
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var basic_authenticator_exports = {};
|
|
28
|
-
__export(basic_authenticator_exports, {
|
|
29
|
-
default: () => AddBasicAuthMigration
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(basic_authenticator_exports);
|
|
32
|
-
var import_server = require("@nocobase/server");
|
|
33
|
-
var import_preset = require("../../preset");
|
|
34
|
-
class AddBasicAuthMigration extends import_server.Migration {
|
|
35
|
-
appVersion = "<0.14.0-alpha.1";
|
|
36
|
-
async up() {
|
|
37
|
-
const repo = this.context.db.getRepository("authenticators");
|
|
38
|
-
const existed = await repo.count();
|
|
39
|
-
if (existed) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
await repo.create({
|
|
43
|
-
values: {
|
|
44
|
-
name: import_preset.presetAuthenticator,
|
|
45
|
-
authType: import_preset.presetAuthType,
|
|
46
|
-
description: "Sign in with username/email.",
|
|
47
|
-
enabled: true
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
async down() {
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { Migration } from '@nocobase/server';
|
|
10
|
-
export default class UpdateBasicAuthMigration extends Migration {
|
|
11
|
-
appVersion: string;
|
|
12
|
-
up(): Promise<void>;
|
|
13
|
-
down(): Promise<void>;
|
|
14
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var update_basic_exports = {};
|
|
28
|
-
__export(update_basic_exports, {
|
|
29
|
-
default: () => UpdateBasicAuthMigration
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(update_basic_exports);
|
|
32
|
-
var import_server = require("@nocobase/server");
|
|
33
|
-
var import_preset = require("../../preset");
|
|
34
|
-
class UpdateBasicAuthMigration extends import_server.Migration {
|
|
35
|
-
appVersion = "<0.14.0-alpha.1";
|
|
36
|
-
async up() {
|
|
37
|
-
const SystemSetting = this.context.db.getRepository("systemSettings");
|
|
38
|
-
const setting = await SystemSetting.findOne();
|
|
39
|
-
const allowSignUp = setting.get("allowSignUp") ? true : false;
|
|
40
|
-
const repo = this.context.db.getRepository("authenticators");
|
|
41
|
-
await repo.update({
|
|
42
|
-
values: {
|
|
43
|
-
options: {
|
|
44
|
-
public: {
|
|
45
|
-
allowSignUp
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
filter: {
|
|
50
|
-
name: import_preset.presetAuthenticator
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
async down() {
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { Migration } from '@nocobase/server';
|
|
10
|
-
export default class FixAllowSignUpMigration extends Migration {
|
|
11
|
-
appVersion: string;
|
|
12
|
-
up(): Promise<void>;
|
|
13
|
-
down(): Promise<void>;
|
|
14
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var fix_allow_signup_exports = {};
|
|
28
|
-
__export(fix_allow_signup_exports, {
|
|
29
|
-
default: () => FixAllowSignUpMigration
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(fix_allow_signup_exports);
|
|
32
|
-
var import_server = require("@nocobase/server");
|
|
33
|
-
var import_preset = require("../../preset");
|
|
34
|
-
class FixAllowSignUpMigration extends import_server.Migration {
|
|
35
|
-
appVersion = "<0.18.0-alpha.1";
|
|
36
|
-
async up() {
|
|
37
|
-
var _a;
|
|
38
|
-
const repo = this.context.db.getRepository("authenticators");
|
|
39
|
-
const authenticators = await repo.find({
|
|
40
|
-
filter: {
|
|
41
|
-
authType: import_preset.presetAuthType
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
for (const authenticator of authenticators) {
|
|
45
|
-
const options = authenticator.get("options");
|
|
46
|
-
const oldAllowSignUp = (_a = options == null ? void 0 : options.public) == null ? void 0 : _a.allowSignup;
|
|
47
|
-
if (oldAllowSignUp === void 0 || oldAllowSignUp === null) {
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
options.public.allowSignUp = oldAllowSignUp;
|
|
51
|
-
delete options.public.allowSignup;
|
|
52
|
-
await repo.update({
|
|
53
|
-
values: {
|
|
54
|
-
options
|
|
55
|
-
},
|
|
56
|
-
filter: {
|
|
57
|
-
name: authenticator.name
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
async down() {
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { Authenticator } from '@nocobase/auth';
|
|
10
|
-
import { Model } from '@nocobase/database';
|
|
11
|
-
export declare class AuthModel extends Model implements Authenticator {
|
|
12
|
-
authType: string;
|
|
13
|
-
options: any;
|
|
14
|
-
findUser(uuid: string): Promise<Model<any, any>>;
|
|
15
|
-
newUser(uuid: string, userValues?: any): Promise<Model<any, any>>;
|
|
16
|
-
findOrCreateUser(uuid: string, userValues?: any): Promise<Model<any, any>>;
|
|
17
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var authenticator_exports = {};
|
|
28
|
-
__export(authenticator_exports, {
|
|
29
|
-
AuthModel: () => AuthModel
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(authenticator_exports);
|
|
32
|
-
var import_database = require("@nocobase/database");
|
|
33
|
-
class AuthModel extends import_database.Model {
|
|
34
|
-
async findUser(uuid) {
|
|
35
|
-
let user;
|
|
36
|
-
const users = await this.getUsers({
|
|
37
|
-
through: {
|
|
38
|
-
where: { uuid }
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
if (users.length) {
|
|
42
|
-
user = users[0];
|
|
43
|
-
return user;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
async newUser(uuid, userValues) {
|
|
47
|
-
let user;
|
|
48
|
-
const db = this.constructor.database;
|
|
49
|
-
await this.sequelize.transaction(async (transaction) => {
|
|
50
|
-
user = await this.createUser(
|
|
51
|
-
userValues || {
|
|
52
|
-
nickname: uuid
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
through: {
|
|
56
|
-
uuid
|
|
57
|
-
},
|
|
58
|
-
transaction
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
await db.emitAsync(`users.afterCreateWithAssociations`, user, {
|
|
62
|
-
transaction
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
return user;
|
|
66
|
-
}
|
|
67
|
-
async findOrCreateUser(uuid, userValues) {
|
|
68
|
-
const user = await this.findUser(uuid);
|
|
69
|
-
if (user) {
|
|
70
|
-
return user;
|
|
71
|
-
}
|
|
72
|
-
return await this.newUser(uuid, userValues);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
76
|
-
0 && (module.exports = {
|
|
77
|
-
AuthModel
|
|
78
|
-
});
|
package/dist/server/plugin.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { Cache } from '@nocobase/cache';
|
|
10
|
-
import { InstallOptions, Plugin } from '@nocobase/server';
|
|
11
|
-
export declare class PluginAuthServer extends Plugin {
|
|
12
|
-
cache: Cache;
|
|
13
|
-
afterAdd(): void;
|
|
14
|
-
beforeLoad(): Promise<void>;
|
|
15
|
-
load(): Promise<void>;
|
|
16
|
-
install(options?: InstallOptions): Promise<void>;
|
|
17
|
-
remove(): Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
export default PluginAuthServer;
|