Skip to content

Commit 6012655

Browse files
icewind1991Backportbot
authored andcommitted
forward error message from password policy
Signed-off-by: Robin Appelman <[email protected]>
1 parent 75b5286 commit 6012655

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/provisioning_api/lib/Controller/UsersController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,11 @@ public function editUser(string $userId, string $key, string $value): DataRespon
512512
$targetUser->setQuota($quota);
513513
break;
514514
case 'password':
515-
$targetUser->setPassword($value);
515+
try {
516+
$targetUser->setPassword($value);
517+
} catch (HintException $e) { // password policy error
518+
throw new OCSException($e->getMessage(), 103);
519+
}
516520
break;
517521
case 'language':
518522
$languagesCodes = $this->l10nFactory->findAvailableLanguages();

0 commit comments

Comments
 (0)