Fix password length limitation

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/34500/head
Joas Schilling 3 years ago
parent a02c8fe01d
commit ab055418c6
No known key found for this signature in database
GPG Key ID: 74434EFE0D2E2205
  1. 6
      apps/provisioning_api/lib/Controller/UsersController.php
  2. 1
      apps/settings/src/components/UserList.vue

@ -389,6 +389,9 @@ class UsersController extends AUserData {
}
$generatePasswordResetToken = false;
if (strlen($password) > 469) {
throw new OCSException('Invalid password value', 101);
}
if ($password === '') {
if ($email === '') {
throw new OCSException('To send a password link to the user an email address is required.', 108);
@ -882,6 +885,9 @@ class UsersController extends AUserData {
break;
case self::USER_FIELD_PASSWORD:
try {
if (strlen($value) > 469) {
throw new OCSException('Invalid password value', 102);
}
if (!$targetUser->canChangePassword()) {
throw new OCSException('Setting the password is not supported by the users backend', 103);
}

@ -56,6 +56,7 @@
ref="newuserpassword"
v-model="newUser.password"
:minlength="minPasswordLength"
:maxlength="469"
:placeholder="t('settings', 'Password')"
:required="newUser.mailAddress===''"
autocapitalize="none"

Loading…
Cancel
Save