@strapi/plugin-users-permissions 4.4.0-alpha.0 → 4.4.0-beta.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.
@@ -152,7 +152,7 @@ const AdvancedSettingsPage = () => {
152
152
  type="submit"
153
153
  disabled={!canUpdate}
154
154
  startIcon={<Check />}
155
- size="L"
155
+ size="S"
156
156
  >
157
157
  {formatMessage({ id: 'global.save', defaultMessage: 'Save' })}
158
158
  </Button>
@@ -131,7 +131,7 @@ const RoleListPage = () => {
131
131
  })}
132
132
  primaryAction={
133
133
  <CheckPermissions permissions={permissions.createRole}>
134
- <Button onClick={handleNewRoleClick} startIcon={<Plus />} size="L">
134
+ <Button onClick={handleNewRoleClick} startIcon={<Plus />} size="S">
135
135
  {formatMessage({
136
136
  id: getTrad('List.button.roles'),
137
137
  defaultMessage: 'Add new role',
@@ -102,6 +102,13 @@ paths:
102
102
  tags:
103
103
  - Users-Permissions - Auth
104
104
  summary: Default Callback from provider auth
105
+ parameters:
106
+ - name: provider
107
+ in: path
108
+ required: true
109
+ description: Provider name
110
+ schema:
111
+ type: string
105
112
  responses:
106
113
  200:
107
114
  description: Returns a jwt token and user info
@@ -196,15 +203,16 @@ paths:
196
203
  application/json:
197
204
  schema:
198
205
  type: object
206
+ required:
207
+ - password
208
+ - currentPassword
209
+ - passwordConfirmation
199
210
  properties:
200
211
  password:
201
- required: true
202
212
  type: string
203
213
  currentPassword:
204
- required: true
205
214
  type: string
206
215
  passwordConfirmation:
207
- required: true
208
216
  type: string
209
217
  responses:
210
218
  200:
@@ -219,7 +227,6 @@ paths:
219
227
  application/json:
220
228
  schema:
221
229
  $ref: '#/components/schemas/Error'
222
-
223
230
  /auth/email-confirmation:
224
231
  get:
225
232
  tags:
@@ -228,7 +235,8 @@ paths:
228
235
  parameters:
229
236
  - in: query
230
237
  name: confirmation
231
- type: string
238
+ schema:
239
+ type: string
232
240
  description: confirmation token received by email
233
241
  responses:
234
242
  301:
@@ -319,7 +327,6 @@ paths:
319
327
  application/json:
320
328
  schema:
321
329
  $ref: '#/components/schemas/Error'
322
-
323
330
  /users-permissions/roles:
324
331
  get:
325
332
  tags:
@@ -364,7 +371,7 @@ paths:
364
371
  - Users-Permissions - Users & Roles
365
372
  summary: Create a role
366
373
  requestBody:
367
- $ref: '#/components/schemas/Users-Permissions-RoleRequest'
374
+ $ref: '#/components/requestBodies/Users-Permissions-RoleRequest'
368
375
  responses:
369
376
  200:
370
377
  description: Returns ok if the role was create
@@ -391,10 +398,13 @@ paths:
391
398
  parameters:
392
399
  - in: path
393
400
  name: id
394
- type: string
401
+ required: true
402
+ schema:
403
+ type: string
395
404
  description: role Id
396
405
  responses:
397
406
  200:
407
+ description: Returns the role
398
408
  content:
399
409
  application/json:
400
410
  schema:
@@ -431,10 +441,12 @@ paths:
431
441
  parameters:
432
442
  - in: path
433
443
  name: role
434
- type: string
444
+ required: true
445
+ schema:
446
+ type: string
435
447
  description: role Id
436
448
  requestBody:
437
- $ref: '#/components/schemas/Users-Permissions-RoleRequest'
449
+ $ref: '#/components/requestBodies/Users-Permissions-RoleRequest'
438
450
  responses:
439
451
  200:
440
452
  description: Returns ok if the role was udpated
@@ -460,7 +472,9 @@ paths:
460
472
  parameters:
461
473
  - in: path
462
474
  name: role
463
- type: string
475
+ required: true
476
+ schema:
477
+ type: string
464
478
  description: role Id
465
479
  responses:
466
480
  200:
@@ -487,7 +501,7 @@ paths:
487
501
  summary: Get list of users
488
502
  responses:
489
503
  200:
490
- summary: Returns an array of users
504
+ description: Returns an array of users
491
505
  content:
492
506
  application/json:
493
507
  schema:
@@ -520,17 +534,17 @@ paths:
520
534
  application/json:
521
535
  schema:
522
536
  type: object
537
+ required:
538
+ - username
539
+ - email
540
+ - password
523
541
  properties:
524
542
  email:
525
543
  type: string
526
- required: true
527
544
  username:
528
545
  type: string
529
- required: true
530
546
  password:
531
547
  type: string
532
- required: true
533
-
534
548
  example:
535
549
  username: foo
536
550
  email: foo@strapi.io
@@ -569,7 +583,6 @@ paths:
569
583
  application/json:
570
584
  schema:
571
585
  $ref: '#/components/schemas/Error'
572
-
573
586
  /users/{id}:
574
587
  get:
575
588
  tags:
@@ -578,10 +591,13 @@ paths:
578
591
  parameters:
579
592
  - in: path
580
593
  name: id
581
- type: string
594
+ required: true
595
+ schema:
596
+ type: string
582
597
  description: user Id
583
598
  responses:
584
599
  200:
600
+ description: Returns a user
585
601
  content:
586
602
  application/json:
587
603
  schema:
@@ -601,7 +617,6 @@ paths:
601
617
  application/json:
602
618
  schema:
603
619
  $ref: '#/components/schemas/Error'
604
-
605
620
  put:
606
621
  tags:
607
622
  - Users-Permissions - Users & Roles
@@ -609,7 +624,9 @@ paths:
609
624
  parameters:
610
625
  - in: path
611
626
  name: id
612
- type: string
627
+ required: true
628
+ schema:
629
+ type: string
613
630
  description: user Id
614
631
  requestBody:
615
632
  required: true
@@ -617,17 +634,17 @@ paths:
617
634
  application/json:
618
635
  schema:
619
636
  type: object
637
+ required:
638
+ - username
639
+ - email
640
+ - password
620
641
  properties:
621
642
  email:
622
643
  type: string
623
- required: true
624
644
  username:
625
645
  type: string
626
- required: true
627
646
  password:
628
647
  type: string
629
- required: true
630
-
631
648
  example:
632
649
  username: foo
633
650
  email: foo@strapi.io
@@ -666,13 +683,19 @@ paths:
666
683
  application/json:
667
684
  schema:
668
685
  $ref: '#/components/schemas/Error'
669
-
670
686
  delete:
671
687
  tags:
672
688
  - Users-Permissions - Users & Roles
673
689
  summary: Delete a user
690
+ parameters:
691
+ - in: path
692
+ name: id
693
+ required: true
694
+ schema:
695
+ type: string
696
+ description: user Id
674
697
  responses:
675
- 200:
698
+ '200':
676
699
  description: Returns deleted user info
677
700
  content:
678
701
  application/json:
@@ -817,6 +840,10 @@ components:
817
840
  policy:
818
841
  type: string
819
842
 
843
+ parameters:
844
+ responses:
845
+ examples:
846
+ requestBodies:
820
847
  Users-Permissions-RoleRequest:
821
848
  required: true
822
849
  content:
@@ -841,8 +868,3 @@ components:
841
868
  controllerA:
842
869
  find:
843
870
  enabled: true
844
-
845
- parameters:
846
- responses:
847
- examples:
848
- requestBodies:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/plugin-users-permissions",
3
- "version": "4.4.0-alpha.0",
3
+ "version": "4.4.0-beta.3",
4
4
  "description": "Protect your API with a full-authentication process based on JWT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,8 +27,8 @@
27
27
  "test:front:watch:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll"
28
28
  },
29
29
  "dependencies": {
30
- "@strapi/helper-plugin": "4.4.0-alpha.0",
31
- "@strapi/utils": "4.4.0-alpha.0",
30
+ "@strapi/helper-plugin": "4.4.0-beta.3",
31
+ "@strapi/utils": "4.4.0-beta.3",
32
32
  "bcryptjs": "2.4.3",
33
33
  "grant-koa": "5.4.8",
34
34
  "jsonwebtoken": "^8.1.0",
@@ -54,7 +54,7 @@
54
54
  "react-test-renderer": "^17.0.2"
55
55
  },
56
56
  "engines": {
57
- "node": ">=14.19.1 <=16.x.x",
57
+ "node": ">=14.19.1 <=18.x.x",
58
58
  "npm": ">=6.0.0"
59
59
  },
60
60
  "strapi": {
@@ -64,5 +64,5 @@
64
64
  "required": true,
65
65
  "kind": "plugin"
66
66
  },
67
- "gitHead": "fc78298ae4f9b247d636beda568734d5f8ed7b3e"
67
+ "gitHead": "baad89e67844d972ef53a6f1b0839a361bf968c0"
68
68
  }
@@ -147,7 +147,7 @@ module.exports = {
147
147
  .query('plugin::users-permissions.user')
148
148
  .findOne({ where: { username } });
149
149
 
150
- if (userWithSameUsername && userWithSameUsername.id != id) {
150
+ if (userWithSameUsername && _.toString(userWithSameUsername.id) !== _.toString(id)) {
151
151
  throw new ApplicationError('Username already taken');
152
152
  }
153
153
  }
@@ -157,7 +157,7 @@ module.exports = {
157
157
  .query('plugin::users-permissions.user')
158
158
  .findOne({ where: { email: _.toLower(email) } });
159
159
 
160
- if (userWithSameEmail && userWithSameEmail.id != id) {
160
+ if (userWithSameEmail && _.toString(userWithSameEmail.id) !== _.toString(id)) {
161
161
  throw new ApplicationError('Email already taken');
162
162
  }
163
163
  body.email = _.toLower(body.email);
@@ -105,7 +105,7 @@ module.exports = {
105
105
  .query('plugin::users-permissions.user')
106
106
  .findOne({ where: { username } });
107
107
 
108
- if (userWithSameUsername && userWithSameUsername.id != id) {
108
+ if (userWithSameUsername && _.toString(userWithSameUsername.id) !== _.toString(id)) {
109
109
  throw new ApplicationError('Username already taken');
110
110
  }
111
111
  }
@@ -115,7 +115,7 @@ module.exports = {
115
115
  .query('plugin::users-permissions.user')
116
116
  .findOne({ where: { email: email.toLowerCase() } });
117
117
 
118
- if (userWithSameEmail && userWithSameEmail.id != id) {
118
+ if (userWithSameEmail && _.toString(userWithSameEmail.id) !== _.toString(id)) {
119
119
  throw new ApplicationError('Email already taken');
120
120
  }
121
121
  ctx.request.body.email = ctx.request.body.email.toLowerCase();