@strapi/plugin-users-permissions 5.10.2 → 5.10.4
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/server/index.js
CHANGED
|
@@ -3462,7 +3462,16 @@ function requireAuth$1() {
|
|
|
3462
3462
|
const createRegisterSchema = (config)=>yup.object({
|
|
3463
3463
|
email: yup.string().email().required(),
|
|
3464
3464
|
username: yup.string().required(),
|
|
3465
|
-
password: yup.string().required().test(
|
|
3465
|
+
password: yup.string().required().test(function(value) {
|
|
3466
|
+
if (!value) return true;
|
|
3467
|
+
const isValid = new TextEncoder().encode(value).length <= 72;
|
|
3468
|
+
if (!isValid) {
|
|
3469
|
+
return this.createError({
|
|
3470
|
+
message: 'Password must be less than 73 bytes'
|
|
3471
|
+
});
|
|
3472
|
+
}
|
|
3473
|
+
return true;
|
|
3474
|
+
}).test(async function(value) {
|
|
3466
3475
|
if (typeof config?.validatePassword === 'function') {
|
|
3467
3476
|
try {
|
|
3468
3477
|
const isValid = await config.validatePassword(value);
|
|
@@ -3490,7 +3499,16 @@ function requireAuth$1() {
|
|
|
3490
3499
|
email: yup.string().email().required()
|
|
3491
3500
|
}).noUnknown();
|
|
3492
3501
|
const createResetPasswordSchema = (config)=>yup.object({
|
|
3493
|
-
password: yup.string().required().test(
|
|
3502
|
+
password: yup.string().required().test(function(value) {
|
|
3503
|
+
if (!value) return true;
|
|
3504
|
+
const isValid = new TextEncoder().encode(value).length <= 72;
|
|
3505
|
+
if (!isValid) {
|
|
3506
|
+
return this.createError({
|
|
3507
|
+
message: 'Password must be less than 73 bytes'
|
|
3508
|
+
});
|
|
3509
|
+
}
|
|
3510
|
+
return true;
|
|
3511
|
+
}).test(async function(value) {
|
|
3494
3512
|
if (typeof config?.validatePassword === 'function') {
|
|
3495
3513
|
try {
|
|
3496
3514
|
const isValid = await config.validatePassword(value);
|
|
@@ -3513,7 +3531,16 @@ function requireAuth$1() {
|
|
|
3513
3531
|
code: yup.string().required()
|
|
3514
3532
|
}).noUnknown();
|
|
3515
3533
|
const createChangePasswordSchema = (config)=>yup.object({
|
|
3516
|
-
password: yup.string().required().test(
|
|
3534
|
+
password: yup.string().required().test(function(value) {
|
|
3535
|
+
if (!value) return true;
|
|
3536
|
+
const isValid = new TextEncoder().encode(value).length <= 72;
|
|
3537
|
+
if (!isValid) {
|
|
3538
|
+
return this.createError({
|
|
3539
|
+
message: 'Password must be less than 73 bytes'
|
|
3540
|
+
});
|
|
3541
|
+
}
|
|
3542
|
+
return true;
|
|
3543
|
+
}).test(async function(value) {
|
|
3517
3544
|
if (typeof config?.validatePassword === 'function') {
|
|
3518
3545
|
try {
|
|
3519
3546
|
const isValid = await config.validatePassword(value);
|