@strapi/plugin-users-permissions 4.2.0-alpha.0 → 4.2.0-alpha.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/plugin-users-permissions",
3
- "version": "4.2.0-alpha.0",
3
+ "version": "4.2.0-alpha.6",
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-alpha.0",
32
- "@strapi/utils": "4.2.0-alpha.0",
31
+ "@strapi/helper-plugin": "4.2.0-alpha.6",
32
+ "@strapi/utils": "4.2.0-alpha.6",
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": "0e1f1ae08565a5f2427753582f37645a43c00cb2"
64
+ "gitHead": "0ec01b421912ac3248487ec7c5ad97cf16be6284"
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, { resetPasswordToken: null, password: params.password });
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
- const user = await getService('user').add(params);
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
  }