@nocobase/plugin-auth 1.4.0-alpha.20241105053324 → 1.4.0-alpha.3
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 +8 -8
- package/dist/locale/en-US.json +2 -1
- package/dist/locale/zh-CN.json +2 -1
- package/dist/node_modules/cron/package.json +1 -1
- package/dist/server/actions/auth.d.ts +0 -3
- package/dist/server/actions/auth.js +42 -13
- package/dist/server/basic-auth.d.ts +0 -1
- package/dist/server/basic-auth.js +2 -34
- package/dist/swagger/index.d.ts +0 -157
- package/dist/swagger/index.js +159 -159
- package/package.json +2 -2
package/dist/externalVersion.js
CHANGED
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.4.0-alpha.
|
|
11
|
+
"@nocobase/client": "1.4.0-alpha.3",
|
|
12
12
|
"react": "18.2.0",
|
|
13
|
-
"@nocobase/utils": "1.4.0-alpha.
|
|
14
|
-
"@nocobase/auth": "1.4.0-alpha.
|
|
15
|
-
"@nocobase/database": "1.4.0-alpha.
|
|
16
|
-
"@nocobase/cache": "1.4.0-alpha.
|
|
17
|
-
"@nocobase/server": "1.4.0-alpha.
|
|
18
|
-
"@nocobase/test": "1.4.0-alpha.
|
|
13
|
+
"@nocobase/utils": "1.4.0-alpha.3",
|
|
14
|
+
"@nocobase/auth": "1.4.0-alpha.3",
|
|
15
|
+
"@nocobase/database": "1.4.0-alpha.3",
|
|
16
|
+
"@nocobase/cache": "1.4.0-alpha.3",
|
|
17
|
+
"@nocobase/server": "1.4.0-alpha.3",
|
|
18
|
+
"@nocobase/test": "1.4.0-alpha.3",
|
|
19
19
|
"antd": "5.12.8",
|
|
20
20
|
"@formily/react": "2.3.0",
|
|
21
21
|
"react-router-dom": "6.21.0",
|
|
@@ -23,5 +23,5 @@ module.exports = {
|
|
|
23
23
|
"react-i18next": "11.18.6",
|
|
24
24
|
"@emotion/css": "11.13.0",
|
|
25
25
|
"@ant-design/icons": "5.2.6",
|
|
26
|
-
"@nocobase/actions": "1.4.0-alpha.
|
|
26
|
+
"@nocobase/actions": "1.4.0-alpha.3"
|
|
27
27
|
};
|
package/dist/locale/en-US.json
CHANGED
|
@@ -23,5 +23,6 @@
|
|
|
23
23
|
"No authentication methods available.": "No authentication methods available.",
|
|
24
24
|
"The password is inconsistent, please re-enter": "The password is inconsistent, please re-enter",
|
|
25
25
|
"Sign-in": "Sign-in",
|
|
26
|
-
"Password": "Password"
|
|
26
|
+
"Password": "Password",
|
|
27
|
+
"The username/email or password is incorrect, please re-enter": "The username/email or password is incorrect, please re-enter"
|
|
27
28
|
}
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -23,5 +23,6 @@
|
|
|
23
23
|
"No authentication methods available.": "没有可用的认证方式。",
|
|
24
24
|
"The password is inconsistent, please re-enter": "密码不一致,请重新输入",
|
|
25
25
|
"Sign-in": "登录",
|
|
26
|
-
"Password": "密码"
|
|
26
|
+
"Password": "密码",
|
|
27
|
+
"The username/email or password is incorrect, please re-enter": "用户名/邮箱或密码有误,请重新输入"
|
|
27
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"cron","description":"Cron jobs for your node","version":"2.4.4","author":"Nick Campbell <nicholas.j.campbell@gmail.com> (https://github.com/ncb000gt)","bugs":{"url":"https://github.com/kelektiv/node-cron/issues"},"repository":{"type":"git","url":"https://github.com/kelektiv/node-cron.git"},"main":"lib/cron","scripts":{"lint":"eslint {lib,tests}/*.js","test":"jest --coverage","test:watch":"jest --watch --coverage","test:types":"tsd","prepare":"husky install","release":"semantic-release"},"types":"types/index.d.ts","dependencies":{"@types/luxon":"~3.3.0","luxon":"~3.3.0"},"devDependencies":{"@commitlint/cli":"~17.6.6","@insurgentlab/commitlint-config":"^18.1.0","@insurgentlab/conventional-changelog-preset":"~6.0.3","@semantic-release/changelog":"~6.0.x","@semantic-release/commit-analyzer":"~9.0.x","@semantic-release/git":"~10.0.x","@semantic-release/github":"~8.1.x","@semantic-release/npm":"~10.0.x","@semantic-release/release-notes-generator":"~11.0.x","chai":"~4.2.x","eslint":"~8.36.x","eslint-config-prettier":"^8.7.x","eslint-config-standard":"~17.0.x","eslint-plugin-import":"~2.27.x","eslint-plugin-jest":"~27.2.x","eslint-plugin-n":"~15.6.x","eslint-plugin-prettier":"~4.2.x","eslint-plugin-promise":"~6.1.x","husky":"^8.0.3","jest":"~29.5.x","prettier":"~2.8.x","semantic-release":"~21.0.x","sinon":"^15.0.x","tsd":"^0.28.1"},"keywords":["cron","node cron","node-cron","schedule","scheduler","cronjob","cron job"],"license":"MIT","contributors":["Brandon der Blätter <https://interlucid.com/contact/> (https://github.com/intcreator)","Romain Beauxis <toots@rastageeks.org> (https://github.com/toots)","James Padolsey <> (https://github.com/jamespadolsey)","Finn Herpich <fh@three-heads.de> (https://github.com/ErrorProne)","Clifton Cunningham <clifton.cunningham@gmail.com> (https://github.com/cliftonc)","Eric Abouaf <eric.abouaf@gmail.com> (https://github.com/neyric)","humanchimp <morphcham@gmail.com> (https://github.com/humanchimp)","Craig Condon <craig@spiceapps.com> (https://github.com/spiceapps)","Dan Bear <daniel@hulu.com> (https://github.com/danhbear)","Vadim Baryshev <vadimbaryshev@gmail.com> (https://github.com/baryshev)","Leandro Ferrari <lfthomaz@gmail.com> (https://github.com/lfthomaz)","Gregg Zigler <greggzigler@gmail.com> (https://github.com/greggzigler)","Jordan Abderrachid <jabderrachid@gmail.com> (https://github.com/jordanabderrachid)","Masakazu Matsushita <matsukaz@gmail.com> (matsukaz)","Christopher Lunt <me@kirisu.co.uk> (https://github.com/kirisu)"],"jest":{"collectCoverage":true,"collectCoverageFrom":["lib/*.js"],"coverageThreshold":{"global":{"statements":80,"branches":80,"functions":70,"lines":80}}},"files":["lib","types","CHANGELOG.md","LICENSE","README.md"],"_lastModified":"2024-11-
|
|
1
|
+
{"name":"cron","description":"Cron jobs for your node","version":"2.4.4","author":"Nick Campbell <nicholas.j.campbell@gmail.com> (https://github.com/ncb000gt)","bugs":{"url":"https://github.com/kelektiv/node-cron/issues"},"repository":{"type":"git","url":"https://github.com/kelektiv/node-cron.git"},"main":"lib/cron","scripts":{"lint":"eslint {lib,tests}/*.js","test":"jest --coverage","test:watch":"jest --watch --coverage","test:types":"tsd","prepare":"husky install","release":"semantic-release"},"types":"types/index.d.ts","dependencies":{"@types/luxon":"~3.3.0","luxon":"~3.3.0"},"devDependencies":{"@commitlint/cli":"~17.6.6","@insurgentlab/commitlint-config":"^18.1.0","@insurgentlab/conventional-changelog-preset":"~6.0.3","@semantic-release/changelog":"~6.0.x","@semantic-release/commit-analyzer":"~9.0.x","@semantic-release/git":"~10.0.x","@semantic-release/github":"~8.1.x","@semantic-release/npm":"~10.0.x","@semantic-release/release-notes-generator":"~11.0.x","chai":"~4.2.x","eslint":"~8.36.x","eslint-config-prettier":"^8.7.x","eslint-config-standard":"~17.0.x","eslint-plugin-import":"~2.27.x","eslint-plugin-jest":"~27.2.x","eslint-plugin-n":"~15.6.x","eslint-plugin-prettier":"~4.2.x","eslint-plugin-promise":"~6.1.x","husky":"^8.0.3","jest":"~29.5.x","prettier":"~2.8.x","semantic-release":"~21.0.x","sinon":"^15.0.x","tsd":"^0.28.1"},"keywords":["cron","node cron","node-cron","schedule","scheduler","cronjob","cron job"],"license":"MIT","contributors":["Brandon der Blätter <https://interlucid.com/contact/> (https://github.com/intcreator)","Romain Beauxis <toots@rastageeks.org> (https://github.com/toots)","James Padolsey <> (https://github.com/jamespadolsey)","Finn Herpich <fh@three-heads.de> (https://github.com/ErrorProne)","Clifton Cunningham <clifton.cunningham@gmail.com> (https://github.com/cliftonc)","Eric Abouaf <eric.abouaf@gmail.com> (https://github.com/neyric)","humanchimp <morphcham@gmail.com> (https://github.com/humanchimp)","Craig Condon <craig@spiceapps.com> (https://github.com/spiceapps)","Dan Bear <daniel@hulu.com> (https://github.com/danhbear)","Vadim Baryshev <vadimbaryshev@gmail.com> (https://github.com/baryshev)","Leandro Ferrari <lfthomaz@gmail.com> (https://github.com/lfthomaz)","Gregg Zigler <greggzigler@gmail.com> (https://github.com/greggzigler)","Jordan Abderrachid <jabderrachid@gmail.com> (https://github.com/jordanabderrachid)","Masakazu Matsushita <matsukaz@gmail.com> (matsukaz)","Christopher Lunt <me@kirisu.co.uk> (https://github.com/kirisu)"],"jest":{"collectCoverage":true,"collectCoverageFrom":["lib/*.js"],"coverageThreshold":{"global":{"statements":80,"branches":80,"functions":70,"lines":80}}},"files":["lib","types","CHANGELOG.md","LICENSE","README.md"],"_lastModified":"2024-11-07T15:07:29.945Z"}
|
|
@@ -8,9 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { Context, Next } from '@nocobase/actions';
|
|
10
10
|
declare const _default: {
|
|
11
|
-
lostPassword: (ctx: Context, next: Next) => Promise<void>;
|
|
12
|
-
resetPassword: (ctx: Context, next: Next) => Promise<void>;
|
|
13
|
-
getUserByResetToken: (ctx: Context, next: Next) => Promise<void>;
|
|
14
11
|
changePassword: (ctx: Context, next: Next) => Promise<void>;
|
|
15
12
|
};
|
|
16
13
|
export default _default;
|
|
@@ -29,22 +29,51 @@ __export(auth_exports, {
|
|
|
29
29
|
default: () => auth_default
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(auth_exports);
|
|
32
|
+
var import_preset = require("../../preset");
|
|
32
33
|
/* istanbul ignore file -- @preserve */
|
|
33
34
|
var auth_default = {
|
|
34
|
-
lostPassword: async (ctx, next) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
resetPassword: async (ctx, next) => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
getUserByResetToken: async (ctx, next) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
35
|
+
// lostPassword: async (ctx: Context, next: Next) => {
|
|
36
|
+
// ctx.body = await ctx.auth.lostPassword();
|
|
37
|
+
// await next();
|
|
38
|
+
// },
|
|
39
|
+
// resetPassword: async (ctx: Context, next: Next) => {
|
|
40
|
+
// ctx.body = await ctx.auth.resetPassword();
|
|
41
|
+
// await next();
|
|
42
|
+
// },
|
|
43
|
+
// getUserByResetToken: async (ctx: Context, next: Next) => {
|
|
44
|
+
// ctx.body = await ctx.auth.getUserByResetToken();
|
|
45
|
+
// await next();
|
|
46
|
+
// },
|
|
46
47
|
changePassword: async (ctx, next) => {
|
|
47
|
-
|
|
48
|
+
const {
|
|
49
|
+
values: { oldPassword, newPassword, confirmPassword }
|
|
50
|
+
} = ctx.action.params;
|
|
51
|
+
if (newPassword !== confirmPassword) {
|
|
52
|
+
ctx.throw(400, ctx.t("The password is inconsistent, please re-enter", { ns: import_preset.namespace }));
|
|
53
|
+
}
|
|
54
|
+
const currentUser = ctx.auth.user;
|
|
55
|
+
if (!currentUser) {
|
|
56
|
+
ctx.throw(401);
|
|
57
|
+
}
|
|
58
|
+
let key;
|
|
59
|
+
if (currentUser.username) {
|
|
60
|
+
key = "username";
|
|
61
|
+
} else {
|
|
62
|
+
key = "email";
|
|
63
|
+
}
|
|
64
|
+
const user = await ctx.db.getRepository("users").findOne({
|
|
65
|
+
where: {
|
|
66
|
+
[key]: currentUser[key]
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const pwd = ctx.db.getCollection("users").getField("password");
|
|
70
|
+
const isValid = await pwd.verify(oldPassword, user.password);
|
|
71
|
+
if (!isValid) {
|
|
72
|
+
ctx.throw(401, ctx.t("The password is incorrect, please re-enter", { ns: import_preset.namespace }));
|
|
73
|
+
}
|
|
74
|
+
user.password = newPassword;
|
|
75
|
+
await user.save();
|
|
76
|
+
ctx.body = currentUser;
|
|
48
77
|
await next();
|
|
49
78
|
}
|
|
50
79
|
};
|
|
@@ -66,12 +66,12 @@ class BasicAuth extends import_auth.BaseAuth {
|
|
|
66
66
|
filter
|
|
67
67
|
});
|
|
68
68
|
if (!user) {
|
|
69
|
-
ctx.throw(401, ctx.t("The username or
|
|
69
|
+
ctx.throw(401, ctx.t("The username/email or password is incorrect, please re-enter", { ns: import_preset.namespace }));
|
|
70
70
|
}
|
|
71
71
|
const field = this.userCollection.getField("password");
|
|
72
72
|
const valid = await field.verify(password, user.password);
|
|
73
73
|
if (!valid) {
|
|
74
|
-
ctx.throw(401, ctx.t("The password is incorrect, please re-enter", { ns: import_preset.namespace }));
|
|
74
|
+
ctx.throw(401, ctx.t("The username/email or password is incorrect, please re-enter", { ns: import_preset.namespace }));
|
|
75
75
|
}
|
|
76
76
|
return user;
|
|
77
77
|
}
|
|
@@ -153,38 +153,6 @@ class BasicAuth extends import_auth.BaseAuth {
|
|
|
153
153
|
}
|
|
154
154
|
return user;
|
|
155
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
156
|
}
|
|
189
157
|
// Annotate the CommonJS export names for ESM import in node:
|
|
190
158
|
0 && (module.exports = {
|
package/dist/swagger/index.d.ts
CHANGED
|
@@ -163,163 +163,6 @@ declare const _default: {
|
|
|
163
163
|
};
|
|
164
164
|
};
|
|
165
165
|
};
|
|
166
|
-
'/auth:lostPassword': {
|
|
167
|
-
post: {
|
|
168
|
-
description: string;
|
|
169
|
-
tags: string[];
|
|
170
|
-
security: any[];
|
|
171
|
-
requestBody: {
|
|
172
|
-
content: {
|
|
173
|
-
'application/json': {
|
|
174
|
-
schema: {
|
|
175
|
-
type: string;
|
|
176
|
-
properties: {
|
|
177
|
-
email: {
|
|
178
|
-
type: string;
|
|
179
|
-
description: string;
|
|
180
|
-
};
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
};
|
|
185
|
-
};
|
|
186
|
-
responses: {
|
|
187
|
-
200: {
|
|
188
|
-
description: string;
|
|
189
|
-
content: {
|
|
190
|
-
'application/json': {
|
|
191
|
-
schema: {
|
|
192
|
-
allOf: ({
|
|
193
|
-
$ref: string;
|
|
194
|
-
type?: undefined;
|
|
195
|
-
properties?: undefined;
|
|
196
|
-
} | {
|
|
197
|
-
type: string;
|
|
198
|
-
properties: {
|
|
199
|
-
resetToken: {
|
|
200
|
-
type: string;
|
|
201
|
-
description: string;
|
|
202
|
-
};
|
|
203
|
-
};
|
|
204
|
-
$ref?: undefined;
|
|
205
|
-
})[];
|
|
206
|
-
};
|
|
207
|
-
};
|
|
208
|
-
};
|
|
209
|
-
};
|
|
210
|
-
400: {
|
|
211
|
-
description: string;
|
|
212
|
-
content: {
|
|
213
|
-
'application/json': {
|
|
214
|
-
schema: {
|
|
215
|
-
$ref: string;
|
|
216
|
-
};
|
|
217
|
-
};
|
|
218
|
-
};
|
|
219
|
-
};
|
|
220
|
-
401: {
|
|
221
|
-
description: string;
|
|
222
|
-
content: {
|
|
223
|
-
'application/json': {
|
|
224
|
-
schema: {
|
|
225
|
-
$ref: string;
|
|
226
|
-
};
|
|
227
|
-
};
|
|
228
|
-
};
|
|
229
|
-
};
|
|
230
|
-
};
|
|
231
|
-
};
|
|
232
|
-
};
|
|
233
|
-
'/auth:resetPassword': {
|
|
234
|
-
post: {
|
|
235
|
-
description: string;
|
|
236
|
-
tags: string[];
|
|
237
|
-
security: any[];
|
|
238
|
-
requestBody: {
|
|
239
|
-
content: {
|
|
240
|
-
'application/json': {
|
|
241
|
-
schema: {
|
|
242
|
-
type: string;
|
|
243
|
-
properties: {
|
|
244
|
-
email: {
|
|
245
|
-
type: string;
|
|
246
|
-
description: string;
|
|
247
|
-
};
|
|
248
|
-
password: {
|
|
249
|
-
type: string;
|
|
250
|
-
description: string;
|
|
251
|
-
};
|
|
252
|
-
resetToken: {
|
|
253
|
-
type: string;
|
|
254
|
-
description: string;
|
|
255
|
-
};
|
|
256
|
-
};
|
|
257
|
-
};
|
|
258
|
-
};
|
|
259
|
-
};
|
|
260
|
-
};
|
|
261
|
-
responses: {
|
|
262
|
-
200: {
|
|
263
|
-
description: string;
|
|
264
|
-
content: {
|
|
265
|
-
'application/json': {
|
|
266
|
-
schema: {
|
|
267
|
-
$ref: string;
|
|
268
|
-
};
|
|
269
|
-
};
|
|
270
|
-
};
|
|
271
|
-
};
|
|
272
|
-
404: {
|
|
273
|
-
description: string;
|
|
274
|
-
content: {
|
|
275
|
-
'application/json': {
|
|
276
|
-
schema: {
|
|
277
|
-
$ref: string;
|
|
278
|
-
};
|
|
279
|
-
};
|
|
280
|
-
};
|
|
281
|
-
};
|
|
282
|
-
};
|
|
283
|
-
};
|
|
284
|
-
};
|
|
285
|
-
'/auth:getUserByResetToken': {
|
|
286
|
-
get: {
|
|
287
|
-
description: string;
|
|
288
|
-
tags: string[];
|
|
289
|
-
security: any[];
|
|
290
|
-
parameters: {
|
|
291
|
-
name: string;
|
|
292
|
-
in: string;
|
|
293
|
-
description: string;
|
|
294
|
-
required: boolean;
|
|
295
|
-
schema: {
|
|
296
|
-
type: string;
|
|
297
|
-
};
|
|
298
|
-
}[];
|
|
299
|
-
responses: {
|
|
300
|
-
200: {
|
|
301
|
-
description: string;
|
|
302
|
-
content: {
|
|
303
|
-
'application/json': {
|
|
304
|
-
schema: {
|
|
305
|
-
$ref: string;
|
|
306
|
-
};
|
|
307
|
-
};
|
|
308
|
-
};
|
|
309
|
-
};
|
|
310
|
-
401: {
|
|
311
|
-
description: string;
|
|
312
|
-
content: {
|
|
313
|
-
'application/json': {
|
|
314
|
-
schema: {
|
|
315
|
-
$ref: string;
|
|
316
|
-
};
|
|
317
|
-
};
|
|
318
|
-
};
|
|
319
|
-
};
|
|
320
|
-
};
|
|
321
|
-
};
|
|
322
|
-
};
|
|
323
166
|
'/auth:changePassword': {
|
|
324
167
|
post: {
|
|
325
168
|
description: string;
|
package/dist/swagger/index.js
CHANGED
|
@@ -190,165 +190,165 @@ var swagger_default = {
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
},
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
},
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
},
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
},
|
|
193
|
+
// '/auth:lostPassword': {
|
|
194
|
+
// post: {
|
|
195
|
+
// description: 'Lost password',
|
|
196
|
+
// tags: ['Basic auth'],
|
|
197
|
+
// security: [],
|
|
198
|
+
// requestBody: {
|
|
199
|
+
// content: {
|
|
200
|
+
// 'application/json': {
|
|
201
|
+
// schema: {
|
|
202
|
+
// type: 'object',
|
|
203
|
+
// properties: {
|
|
204
|
+
// email: {
|
|
205
|
+
// type: 'string',
|
|
206
|
+
// description: '邮箱',
|
|
207
|
+
// },
|
|
208
|
+
// },
|
|
209
|
+
// },
|
|
210
|
+
// },
|
|
211
|
+
// },
|
|
212
|
+
// },
|
|
213
|
+
// responses: {
|
|
214
|
+
// 200: {
|
|
215
|
+
// description: 'successful operation',
|
|
216
|
+
// content: {
|
|
217
|
+
// 'application/json': {
|
|
218
|
+
// schema: {
|
|
219
|
+
// allOf: [
|
|
220
|
+
// {
|
|
221
|
+
// $ref: '#/components/schemas/user',
|
|
222
|
+
// },
|
|
223
|
+
// {
|
|
224
|
+
// type: 'object',
|
|
225
|
+
// properties: {
|
|
226
|
+
// resetToken: {
|
|
227
|
+
// type: 'string',
|
|
228
|
+
// description: '重置密码的token',
|
|
229
|
+
// },
|
|
230
|
+
// },
|
|
231
|
+
// },
|
|
232
|
+
// ],
|
|
233
|
+
// },
|
|
234
|
+
// },
|
|
235
|
+
// },
|
|
236
|
+
// },
|
|
237
|
+
// 400: {
|
|
238
|
+
// description: 'Please fill in your email address',
|
|
239
|
+
// content: {
|
|
240
|
+
// 'application/json': {
|
|
241
|
+
// schema: {
|
|
242
|
+
// $ref: '#/components/schemas/error',
|
|
243
|
+
// },
|
|
244
|
+
// },
|
|
245
|
+
// },
|
|
246
|
+
// },
|
|
247
|
+
// 401: {
|
|
248
|
+
// description: 'The email is incorrect, please re-enter',
|
|
249
|
+
// content: {
|
|
250
|
+
// 'application/json': {
|
|
251
|
+
// schema: {
|
|
252
|
+
// $ref: '#/components/schemas/error',
|
|
253
|
+
// },
|
|
254
|
+
// },
|
|
255
|
+
// },
|
|
256
|
+
// },
|
|
257
|
+
// },
|
|
258
|
+
// },
|
|
259
|
+
// },
|
|
260
|
+
// '/auth:resetPassword': {
|
|
261
|
+
// post: {
|
|
262
|
+
// description: 'Reset password',
|
|
263
|
+
// tags: ['Basic auth'],
|
|
264
|
+
// security: [],
|
|
265
|
+
// requestBody: {
|
|
266
|
+
// content: {
|
|
267
|
+
// 'application/json': {
|
|
268
|
+
// schema: {
|
|
269
|
+
// type: 'object',
|
|
270
|
+
// properties: {
|
|
271
|
+
// email: {
|
|
272
|
+
// type: 'string',
|
|
273
|
+
// description: '邮箱',
|
|
274
|
+
// },
|
|
275
|
+
// password: {
|
|
276
|
+
// type: 'string',
|
|
277
|
+
// description: '密码',
|
|
278
|
+
// },
|
|
279
|
+
// resetToken: {
|
|
280
|
+
// type: 'string',
|
|
281
|
+
// description: '重置密码的token',
|
|
282
|
+
// },
|
|
283
|
+
// },
|
|
284
|
+
// },
|
|
285
|
+
// },
|
|
286
|
+
// },
|
|
287
|
+
// },
|
|
288
|
+
// responses: {
|
|
289
|
+
// 200: {
|
|
290
|
+
// description: 'successful operation',
|
|
291
|
+
// content: {
|
|
292
|
+
// 'application/json': {
|
|
293
|
+
// schema: {
|
|
294
|
+
// $ref: '#/components/schemas/user',
|
|
295
|
+
// },
|
|
296
|
+
// },
|
|
297
|
+
// },
|
|
298
|
+
// },
|
|
299
|
+
// 404: {
|
|
300
|
+
// description: 'User not found',
|
|
301
|
+
// content: {
|
|
302
|
+
// 'application/json': {
|
|
303
|
+
// schema: {
|
|
304
|
+
// $ref: '#/components/schemas/error',
|
|
305
|
+
// },
|
|
306
|
+
// },
|
|
307
|
+
// },
|
|
308
|
+
// },
|
|
309
|
+
// },
|
|
310
|
+
// },
|
|
311
|
+
// },
|
|
312
|
+
// '/auth:getUserByResetToken': {
|
|
313
|
+
// get: {
|
|
314
|
+
// description: 'Get user by reset token',
|
|
315
|
+
// tags: ['Basic auth'],
|
|
316
|
+
// security: [],
|
|
317
|
+
// parameters: [
|
|
318
|
+
// {
|
|
319
|
+
// name: 'token',
|
|
320
|
+
// in: 'query',
|
|
321
|
+
// description: '重置密码的token',
|
|
322
|
+
// required: true,
|
|
323
|
+
// schema: {
|
|
324
|
+
// type: 'string',
|
|
325
|
+
// },
|
|
326
|
+
// },
|
|
327
|
+
// ],
|
|
328
|
+
// responses: {
|
|
329
|
+
// 200: {
|
|
330
|
+
// description: 'ok',
|
|
331
|
+
// content: {
|
|
332
|
+
// 'application/json': {
|
|
333
|
+
// schema: {
|
|
334
|
+
// $ref: '#/components/schemas/user',
|
|
335
|
+
// },
|
|
336
|
+
// },
|
|
337
|
+
// },
|
|
338
|
+
// },
|
|
339
|
+
// 401: {
|
|
340
|
+
// description: 'Unauthorized',
|
|
341
|
+
// content: {
|
|
342
|
+
// 'application/json': {
|
|
343
|
+
// schema: {
|
|
344
|
+
// $ref: '#/components/schemas/error',
|
|
345
|
+
// },
|
|
346
|
+
// },
|
|
347
|
+
// },
|
|
348
|
+
// },
|
|
349
|
+
// },
|
|
350
|
+
// },
|
|
351
|
+
// },
|
|
352
352
|
"/auth:changePassword": {
|
|
353
353
|
post: {
|
|
354
354
|
description: "Change password",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-auth",
|
|
3
|
-
"version": "1.4.0-alpha.
|
|
3
|
+
"version": "1.4.0-alpha.3",
|
|
4
4
|
"main": "./dist/server/index.js",
|
|
5
5
|
"homepage": "https://docs.nocobase.com/handbook/auth",
|
|
6
6
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/auth",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"displayName.zh-CN": "用户认证",
|
|
27
27
|
"description": "User authentication management, including password, SMS, and support for Single Sign-On (SSO) protocols, with extensibility.",
|
|
28
28
|
"description.zh-CN": "用户认证管理,包括基础的密码认证、短信认证、SSO 协议的认证等,可扩展。",
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "9268a5b29cbbe9f83255e5cd66fa82f012aab46a",
|
|
30
30
|
"keywords": [
|
|
31
31
|
"Authentication"
|
|
32
32
|
]
|