Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(files_sharing): Do not wrap password policy exception into a gene…
…ric one

Let the controller access the HintException and show the error to the user.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Dec 12, 2024
commit 28d7206e5cab68eb4b4a012574ee26275e2c74d8
8 changes: 2 additions & 6 deletions lib/private/Share20/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private function splitFullId($id) {
* Verify if a password meets all requirements
*
* @param string $password
* @throws \Exception
* @throws HintException
*/
protected function verifyPassword($password) {
if ($password === null) {
Expand All @@ -112,11 +112,7 @@ protected function verifyPassword($password) {
}

// Let others verify the password
try {
$this->dispatcher->dispatchTyped(new ValidatePasswordPolicyEvent($password));
} catch (HintException $e) {
throw new \Exception($e->getHint());
}
$this->dispatcher->dispatchTyped(new ValidatePasswordPolicyEvent($password));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still disappointed that this is done using exceptions rather than setting property on the even like isValid...

}

/**
Expand Down