@nocobase/plugin-auth 1.2.13-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,192 +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 basic_auth_exports = {};
|
|
38
|
-
__export(basic_auth_exports, {
|
|
39
|
-
BasicAuth: () => BasicAuth
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(basic_auth_exports);
|
|
42
|
-
var import_auth = require("@nocobase/auth");
|
|
43
|
-
var import_crypto = __toESM(require("crypto"));
|
|
44
|
-
var import_preset = require("../preset");
|
|
45
|
-
class BasicAuth extends import_auth.BaseAuth {
|
|
46
|
-
constructor(config) {
|
|
47
|
-
const userCollection = config.ctx.db.getCollection("users");
|
|
48
|
-
super({ ...config, userCollection });
|
|
49
|
-
}
|
|
50
|
-
async validate() {
|
|
51
|
-
const ctx = this.ctx;
|
|
52
|
-
const {
|
|
53
|
-
account,
|
|
54
|
-
// Username or email
|
|
55
|
-
email,
|
|
56
|
-
// Old parameter, compatible with old api
|
|
57
|
-
password
|
|
58
|
-
} = ctx.action.params.values || {};
|
|
59
|
-
if (!account && !email) {
|
|
60
|
-
ctx.throw(400, ctx.t("Please enter your username or email", { ns: import_preset.namespace }));
|
|
61
|
-
}
|
|
62
|
-
const filter = email ? { email } : {
|
|
63
|
-
$or: [{ username: account }, { email: account }]
|
|
64
|
-
};
|
|
65
|
-
const user = await this.userRepository.findOne({
|
|
66
|
-
filter
|
|
67
|
-
});
|
|
68
|
-
if (!user) {
|
|
69
|
-
ctx.throw(401, ctx.t("The username or email is incorrect, please re-enter", { ns: import_preset.namespace }));
|
|
70
|
-
}
|
|
71
|
-
const field = this.userCollection.getField("password");
|
|
72
|
-
const valid = await field.verify(password, user.password);
|
|
73
|
-
if (!valid) {
|
|
74
|
-
ctx.throw(401, ctx.t("The password is incorrect, please re-enter", { ns: import_preset.namespace }));
|
|
75
|
-
}
|
|
76
|
-
return user;
|
|
77
|
-
}
|
|
78
|
-
async signUp() {
|
|
79
|
-
var _a;
|
|
80
|
-
const ctx = this.ctx;
|
|
81
|
-
const options = ((_a = this.authenticator.options) == null ? void 0 : _a.public) || {};
|
|
82
|
-
if (!options.allowSignUp) {
|
|
83
|
-
ctx.throw(403, ctx.t("Not allowed to sign up", { ns: import_preset.namespace }));
|
|
84
|
-
}
|
|
85
|
-
const User = ctx.db.getRepository("users");
|
|
86
|
-
const { values } = ctx.action.params;
|
|
87
|
-
const { username, password, confirm_password } = values;
|
|
88
|
-
if (!this.validateUsername(username)) {
|
|
89
|
-
ctx.throw(400, ctx.t("Please enter a valid username", { ns: import_preset.namespace }));
|
|
90
|
-
}
|
|
91
|
-
if (!password) {
|
|
92
|
-
ctx.throw(400, ctx.t("Please enter a password", { ns: import_preset.namespace }));
|
|
93
|
-
}
|
|
94
|
-
if (password !== confirm_password) {
|
|
95
|
-
ctx.throw(400, ctx.t("The password is inconsistent, please re-enter", { ns: import_preset.namespace }));
|
|
96
|
-
}
|
|
97
|
-
const user = await User.create({ values: { username, password } });
|
|
98
|
-
return user;
|
|
99
|
-
}
|
|
100
|
-
/* istanbul ignore next -- @preserve */
|
|
101
|
-
async lostPassword() {
|
|
102
|
-
const ctx = this.ctx;
|
|
103
|
-
const {
|
|
104
|
-
values: { email }
|
|
105
|
-
} = ctx.action.params;
|
|
106
|
-
if (!email) {
|
|
107
|
-
ctx.throw(400, ctx.t("Please fill in your email address", { ns: import_preset.namespace }));
|
|
108
|
-
}
|
|
109
|
-
const user = await this.userRepository.findOne({
|
|
110
|
-
where: {
|
|
111
|
-
email
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
if (!user) {
|
|
115
|
-
ctx.throw(401, ctx.t("The email is incorrect, please re-enter", { ns: import_preset.namespace }));
|
|
116
|
-
}
|
|
117
|
-
user.resetToken = import_crypto.default.randomBytes(20).toString("hex");
|
|
118
|
-
await user.save();
|
|
119
|
-
return user;
|
|
120
|
-
}
|
|
121
|
-
/* istanbul ignore next -- @preserve */
|
|
122
|
-
async resetPassword() {
|
|
123
|
-
const ctx = this.ctx;
|
|
124
|
-
const {
|
|
125
|
-
values: { email, password, resetToken }
|
|
126
|
-
} = ctx.action.params;
|
|
127
|
-
const user = await this.userRepository.findOne({
|
|
128
|
-
where: {
|
|
129
|
-
email,
|
|
130
|
-
resetToken
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
if (!user) {
|
|
134
|
-
ctx.throw(404);
|
|
135
|
-
}
|
|
136
|
-
user.token = null;
|
|
137
|
-
user.resetToken = null;
|
|
138
|
-
user.password = password;
|
|
139
|
-
await user.save();
|
|
140
|
-
return user;
|
|
141
|
-
}
|
|
142
|
-
/* istanbul ignore next -- @preserve */
|
|
143
|
-
async getUserByResetToken() {
|
|
144
|
-
const ctx = this.ctx;
|
|
145
|
-
const { token } = ctx.action.params;
|
|
146
|
-
const user = await this.userRepository.findOne({
|
|
147
|
-
where: {
|
|
148
|
-
resetToken: token
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
if (!user) {
|
|
152
|
-
ctx.throw(401);
|
|
153
|
-
}
|
|
154
|
-
return user;
|
|
155
|
-
}
|
|
156
|
-
async changePassword() {
|
|
157
|
-
const ctx = this.ctx;
|
|
158
|
-
const {
|
|
159
|
-
values: { oldPassword, newPassword, confirmPassword }
|
|
160
|
-
} = ctx.action.params;
|
|
161
|
-
if (newPassword !== confirmPassword) {
|
|
162
|
-
ctx.throw(400, ctx.t("The password is inconsistent, please re-enter", { ns: import_preset.namespace }));
|
|
163
|
-
}
|
|
164
|
-
const currentUser = ctx.auth.user;
|
|
165
|
-
if (!currentUser) {
|
|
166
|
-
ctx.throw(401);
|
|
167
|
-
}
|
|
168
|
-
let key;
|
|
169
|
-
if (currentUser.username) {
|
|
170
|
-
key = "username";
|
|
171
|
-
} else {
|
|
172
|
-
key = "email";
|
|
173
|
-
}
|
|
174
|
-
const user = await this.userRepository.findOne({
|
|
175
|
-
where: {
|
|
176
|
-
[key]: currentUser[key]
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
const pwd = this.userCollection.getField("password");
|
|
180
|
-
const isValid = await pwd.verify(oldPassword, user.password);
|
|
181
|
-
if (!isValid) {
|
|
182
|
-
ctx.throw(401, ctx.t("The password is incorrect, please re-enter", { ns: import_preset.namespace }));
|
|
183
|
-
}
|
|
184
|
-
user.password = newPassword;
|
|
185
|
-
await user.save();
|
|
186
|
-
return currentUser;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
190
|
-
0 && (module.exports = {
|
|
191
|
-
BasicAuth
|
|
192
|
-
});
|
|
@@ -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
|
-
/**
|
|
10
|
-
* Collection for extended authentication methods,
|
|
11
|
-
*/
|
|
12
|
-
declare const _default: import("@nocobase/database").CollectionOptions;
|
|
13
|
-
export default _default;
|
|
@@ -1,126 +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 authenticators_exports = {};
|
|
28
|
-
__export(authenticators_exports, {
|
|
29
|
-
default: () => authenticators_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(authenticators_exports);
|
|
32
|
-
var import_database = require("@nocobase/database");
|
|
33
|
-
var authenticators_default = (0, import_database.defineCollection)({
|
|
34
|
-
dumpRules: {
|
|
35
|
-
group: "third-party"
|
|
36
|
-
},
|
|
37
|
-
shared: true,
|
|
38
|
-
name: "authenticators",
|
|
39
|
-
sortable: true,
|
|
40
|
-
model: "AuthModel",
|
|
41
|
-
createdBy: true,
|
|
42
|
-
updatedBy: true,
|
|
43
|
-
logging: true,
|
|
44
|
-
fields: [
|
|
45
|
-
{
|
|
46
|
-
name: "id",
|
|
47
|
-
type: "bigInt",
|
|
48
|
-
autoIncrement: true,
|
|
49
|
-
primaryKey: true,
|
|
50
|
-
allowNull: false,
|
|
51
|
-
interface: "id"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
interface: "input",
|
|
55
|
-
type: "string",
|
|
56
|
-
name: "name",
|
|
57
|
-
allowNull: false,
|
|
58
|
-
unique: true,
|
|
59
|
-
uiSchema: {
|
|
60
|
-
type: "string",
|
|
61
|
-
title: '{{t("Name")}}',
|
|
62
|
-
"x-component": "Input",
|
|
63
|
-
required: true
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
interface: "input",
|
|
68
|
-
type: "string",
|
|
69
|
-
name: "authType",
|
|
70
|
-
allowNull: false,
|
|
71
|
-
uiSchema: {
|
|
72
|
-
type: "string",
|
|
73
|
-
title: '{{t("Auth Type")}}',
|
|
74
|
-
"x-component": "Input",
|
|
75
|
-
required: true
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
interface: "input",
|
|
80
|
-
type: "string",
|
|
81
|
-
name: "title",
|
|
82
|
-
uiSchema: {
|
|
83
|
-
type: "string",
|
|
84
|
-
title: '{{t("Title")}}',
|
|
85
|
-
"x-component": "Input"
|
|
86
|
-
},
|
|
87
|
-
translation: true
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
interface: "textarea",
|
|
91
|
-
type: "string",
|
|
92
|
-
name: "description",
|
|
93
|
-
allowNull: false,
|
|
94
|
-
defaultValue: "",
|
|
95
|
-
uiSchema: {
|
|
96
|
-
type: "string",
|
|
97
|
-
title: '{{t("Description")}}',
|
|
98
|
-
"x-component": "Input",
|
|
99
|
-
required: true
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
type: "json",
|
|
104
|
-
name: "options",
|
|
105
|
-
allowNull: false,
|
|
106
|
-
defaultValue: {}
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
type: "boolean",
|
|
110
|
-
name: "enabled",
|
|
111
|
-
defaultValue: false
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
interface: "m2m",
|
|
115
|
-
type: "belongsToMany",
|
|
116
|
-
name: "users",
|
|
117
|
-
target: "users",
|
|
118
|
-
foreignKey: "authenticator",
|
|
119
|
-
otherKey: "userId",
|
|
120
|
-
onDelete: "CASCADE",
|
|
121
|
-
sourceKey: "name",
|
|
122
|
-
targetKey: "id",
|
|
123
|
-
through: "usersAuthenticators"
|
|
124
|
-
}
|
|
125
|
-
]
|
|
126
|
-
});
|
|
@@ -1,10 +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: import("@nocobase/database").CollectionOptions;
|
|
10
|
-
export default _default;
|
|
@@ -1,51 +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 token_blacklist_exports = {};
|
|
28
|
-
__export(token_blacklist_exports, {
|
|
29
|
-
default: () => token_blacklist_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(token_blacklist_exports);
|
|
32
|
-
var import_database = require("@nocobase/database");
|
|
33
|
-
var token_blacklist_default = (0, import_database.defineCollection)({
|
|
34
|
-
dumpRules: {
|
|
35
|
-
group: "log"
|
|
36
|
-
},
|
|
37
|
-
shared: true,
|
|
38
|
-
name: "tokenBlacklist",
|
|
39
|
-
model: "TokenBlacklistModel",
|
|
40
|
-
fields: [
|
|
41
|
-
{
|
|
42
|
-
type: "string",
|
|
43
|
-
name: "token",
|
|
44
|
-
index: true
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
type: "date",
|
|
48
|
-
name: "expiration"
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
});
|
|
@@ -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
|
-
/**
|
|
10
|
-
* Collection for user information of extended authentication methods,
|
|
11
|
-
* such as saml, oicd, oauth, sms, etc.
|
|
12
|
-
*/
|
|
13
|
-
declare const _default: import("@nocobase/database").CollectionOptions;
|
|
14
|
-
export default _default;
|
|
@@ -1,94 +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 users_authenticators_exports = {};
|
|
28
|
-
__export(users_authenticators_exports, {
|
|
29
|
-
default: () => users_authenticators_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(users_authenticators_exports);
|
|
32
|
-
var import_database = require("@nocobase/database");
|
|
33
|
-
var users_authenticators_default = (0, import_database.defineCollection)({
|
|
34
|
-
dumpRules: {
|
|
35
|
-
group: "user"
|
|
36
|
-
},
|
|
37
|
-
shared: true,
|
|
38
|
-
name: "usersAuthenticators",
|
|
39
|
-
model: "UserAuthModel",
|
|
40
|
-
createdBy: true,
|
|
41
|
-
updatedBy: true,
|
|
42
|
-
logging: true,
|
|
43
|
-
fields: [
|
|
44
|
-
/**
|
|
45
|
-
* uuid:
|
|
46
|
-
* Unique user id of the authentication method, such as wechat openid, phone number, etc.
|
|
47
|
-
*/
|
|
48
|
-
{
|
|
49
|
-
name: "uuid",
|
|
50
|
-
interface: "input",
|
|
51
|
-
type: "string",
|
|
52
|
-
allowNull: false,
|
|
53
|
-
uiSchema: {
|
|
54
|
-
type: "string",
|
|
55
|
-
title: '{{t("UUID")}}',
|
|
56
|
-
"x-component": "Input",
|
|
57
|
-
required: true
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
interface: "input",
|
|
62
|
-
type: "string",
|
|
63
|
-
name: "nickname",
|
|
64
|
-
allowNull: false,
|
|
65
|
-
defaultValue: "",
|
|
66
|
-
uiSchema: {
|
|
67
|
-
type: "string",
|
|
68
|
-
title: '{{t("Nickname")}}',
|
|
69
|
-
"x-component": "Input"
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
interface: "attachment",
|
|
74
|
-
type: "string",
|
|
75
|
-
name: "avatar",
|
|
76
|
-
allowNull: false,
|
|
77
|
-
defaultValue: "",
|
|
78
|
-
uiSchema: {
|
|
79
|
-
type: "string",
|
|
80
|
-
title: '{{t("Avatar")}}',
|
|
81
|
-
"x-component": "Upload"
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
/**
|
|
85
|
-
* meta:
|
|
86
|
-
* Metadata, some other information of the authentication method.
|
|
87
|
-
*/
|
|
88
|
-
{
|
|
89
|
-
type: "json",
|
|
90
|
-
name: "meta",
|
|
91
|
-
defaultValue: {}
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
});
|
package/dist/server/index.d.ts
DELETED
|
@@ -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 { BasicAuth } from './basic-auth';
|
|
10
|
-
export { AuthModel } from './model/authenticator';
|
|
11
|
-
export { default } from './plugin';
|
package/dist/server/index.js
DELETED
|
@@ -1,51 +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 server_exports = {};
|
|
38
|
-
__export(server_exports, {
|
|
39
|
-
AuthModel: () => import_authenticator.AuthModel,
|
|
40
|
-
BasicAuth: () => import_basic_auth.BasicAuth,
|
|
41
|
-
default: () => import_plugin.default
|
|
42
|
-
});
|
|
43
|
-
module.exports = __toCommonJS(server_exports);
|
|
44
|
-
var import_basic_auth = require("./basic-auth");
|
|
45
|
-
var import_authenticator = require("./model/authenticator");
|
|
46
|
-
var import_plugin = __toESM(require("./plugin"));
|
|
47
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
-
0 && (module.exports = {
|
|
49
|
-
AuthModel,
|
|
50
|
-
BasicAuth
|
|
51
|
-
});
|
|
@@ -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 en_US_exports = {};
|
|
28
|
-
__export(en_US_exports, {
|
|
29
|
-
default: () => en_US_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(en_US_exports);
|
|
32
|
-
var en_US_default = {
|
|
33
|
-
"The email is incorrect, please re-enter": "The email is incorrect, please re-enter",
|
|
34
|
-
"Please fill in your email address": "Please fill in your email address",
|
|
35
|
-
"The password is incorrect, please re-enter": "The password is incorrect, please re-enter",
|
|
36
|
-
"Not a valid cellphone number, please re-enter": "Not a valid cellphone number, please re-enter",
|
|
37
|
-
"The phone number has been registered, please login directly": "The phone number has been registered, please login directly",
|
|
38
|
-
"The phone number is not registered, please register first": "The phone number is not registered, please register first"
|
|
39
|
-
};
|
|
@@ -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 fr_FR_exports = {};
|
|
28
|
-
__export(fr_FR_exports, {
|
|
29
|
-
default: () => fr_FR_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(fr_FR_exports);
|
|
32
|
-
var fr_FR_default = {
|
|
33
|
-
"The email is incorrect, please re-enter": "L'email est incorrect, veuillez le saisir \xE0 nouveau",
|
|
34
|
-
"Please fill in your email address": "Veuillez remplir votre adresse e-mail",
|
|
35
|
-
"The password is incorrect, please re-enter": "Le mot de passe est incorrect, veuillez le saisir \xE0 nouveau",
|
|
36
|
-
"Not a valid cellphone number, please re-enter": "Num\xE9ro de t\xE9l\xE9phone portable non valide, veuillez le saisir \xE0 nouveau",
|
|
37
|
-
"The phone number has been registered, please login directly": "Le num\xE9ro de t\xE9l\xE9phone a \xE9t\xE9 enregistr\xE9, veuillez vous connecter directement",
|
|
38
|
-
"The phone number is not registered, please register first": "Le num\xE9ro de t\xE9l\xE9phone n'est pas enregistr\xE9, veuillez vous inscrire d'abord"
|
|
39
|
-
};
|