@strapi/plugin-users-permissions 5.10.1 → 5.10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/plugin-users-permissions",
3
- "version": "5.10.1",
3
+ "version": "5.10.3",
4
4
  "description": "Protect your API with a full-authentication process based on JWT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -50,7 +50,7 @@
50
50
  "dependencies": {
51
51
  "@strapi/design-system": "2.0.0-rc.16",
52
52
  "@strapi/icons": "2.0.0-rc.16",
53
- "@strapi/utils": "5.10.1",
53
+ "@strapi/utils": "5.10.3",
54
54
  "bcryptjs": "2.4.3",
55
55
  "formik": "2.4.5",
56
56
  "grant": "^5.4.8",
@@ -69,7 +69,7 @@
69
69
  "yup": "0.32.9"
70
70
  },
71
71
  "devDependencies": {
72
- "@strapi/strapi": "5.10.1",
72
+ "@strapi/strapi": "5.10.3",
73
73
  "@testing-library/dom": "10.1.0",
74
74
  "@testing-library/react": "15.0.7",
75
75
  "@testing-library/user-event": "14.5.2",
@@ -14,6 +14,14 @@ const createRegisterSchema = (config) =>
14
14
  password: yup
15
15
  .string()
16
16
  .required()
17
+ .test(function (value) {
18
+ if (!value) return true;
19
+ const isValid = new TextEncoder().encode(value).length <= 72;
20
+ if (!isValid) {
21
+ return this.createError({ message: 'Password must be less than 73 bytes' });
22
+ }
23
+ return true;
24
+ })
17
25
  .test(async function (value) {
18
26
  if (typeof config?.validatePassword === 'function') {
19
27
  try {
@@ -49,6 +57,14 @@ const createResetPasswordSchema = (config) =>
49
57
  password: yup
50
58
  .string()
51
59
  .required()
60
+ .test(function (value) {
61
+ if (!value) return true;
62
+ const isValid = new TextEncoder().encode(value).length <= 72;
63
+ if (!isValid) {
64
+ return this.createError({ message: 'Password must be less than 73 bytes' });
65
+ }
66
+ return true;
67
+ })
52
68
  .test(async function (value) {
53
69
  if (typeof config?.validatePassword === 'function') {
54
70
  try {
@@ -62,7 +78,6 @@ const createResetPasswordSchema = (config) =>
62
78
  }
63
79
  return true;
64
80
  }),
65
-
66
81
  passwordConfirmation: yup
67
82
  .string()
68
83
  .required()
@@ -78,6 +93,14 @@ const createChangePasswordSchema = (config) =>
78
93
  password: yup
79
94
  .string()
80
95
  .required()
96
+ .test(function (value) {
97
+ if (!value) return true;
98
+ const isValid = new TextEncoder().encode(value).length <= 72;
99
+ if (!isValid) {
100
+ return this.createError({ message: 'Password must be less than 73 bytes' });
101
+ }
102
+ return true;
103
+ })
81
104
  .test(async function (value) {
82
105
  if (typeof config?.validatePassword === 'function') {
83
106
  try {