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