@strapi/plugin-users-permissions 4.2.0-alpha.O → 4.2.0-beta.0
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 +4 -4
- package/server/controllers/auth.js +12 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/plugin-users-permissions",
|
|
3
|
-
"version": "4.2.0-
|
|
3
|
+
"version": "4.2.0-beta.0",
|
|
4
4
|
"description": "Protect your API with a full-authentication process based on JWT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@purest/providers": "^1.0.2",
|
|
31
|
-
"@strapi/helper-plugin": "4.2.0-
|
|
32
|
-
"@strapi/utils": "4.2.0-
|
|
31
|
+
"@strapi/helper-plugin": "4.2.0-beta.0",
|
|
32
|
+
"@strapi/utils": "4.2.0-beta.0",
|
|
33
33
|
"bcryptjs": "2.4.3",
|
|
34
34
|
"grant-koa": "5.4.8",
|
|
35
35
|
"jsonwebtoken": "^8.1.0",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"required": true,
|
|
62
62
|
"kind": "plugin"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "db70f0de7cc73fb469c8a076b89530729cf14142"
|
|
65
65
|
}
|
|
@@ -137,7 +137,10 @@ module.exports = {
|
|
|
137
137
|
throw new ValidationError('Incorrect code provided');
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
await getService('user').edit(user.id, {
|
|
140
|
+
await getService('user').edit(user.id, {
|
|
141
|
+
resetPasswordToken: null,
|
|
142
|
+
password: params.password,
|
|
143
|
+
});
|
|
141
144
|
// Update the user.
|
|
142
145
|
ctx.send({
|
|
143
146
|
jwt: getService('jwt').issue({ id: user.id }),
|
|
@@ -338,7 +341,7 @@ module.exports = {
|
|
|
338
341
|
params.confirmed = true;
|
|
339
342
|
}
|
|
340
343
|
|
|
341
|
-
|
|
344
|
+
const user = await getService('user').add(params);
|
|
342
345
|
|
|
343
346
|
const sanitizedUser = await sanitizeUser(user, ctx);
|
|
344
347
|
|
|
@@ -419,6 +422,13 @@ module.exports = {
|
|
|
419
422
|
where: { email: params.email },
|
|
420
423
|
});
|
|
421
424
|
|
|
425
|
+
if (!user) {
|
|
426
|
+
return ctx.send({
|
|
427
|
+
email: params.email,
|
|
428
|
+
sent: true,
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
|
|
422
432
|
if (user.confirmed) {
|
|
423
433
|
throw new ApplicationError('already.confirmed');
|
|
424
434
|
}
|