mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
fix(shares): Wrap exceptions from password validation to set code to 400
This fixes a regression that bad password returned 403 instead of 400 because of previous changes. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
28d7206e5c
commit
17007f6b8d
1 changed files with 7 additions and 2 deletions
|
|
@ -112,7 +112,12 @@ class Manager implements IManager {
|
|||
}
|
||||
|
||||
// Let others verify the password
|
||||
$this->dispatcher->dispatchTyped(new ValidatePasswordPolicyEvent($password));
|
||||
try {
|
||||
$this->dispatcher->dispatchTyped(new ValidatePasswordPolicyEvent($password));
|
||||
} catch (HintException $e) {
|
||||
/* Wrap in a 400 bad request error */
|
||||
throw new HintException($e->getMessage(), $e->getHint(), 400, $e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -780,7 +785,7 @@ class Manager implements IManager {
|
|||
* @param IShare $share
|
||||
* @return IShare The share object
|
||||
* @throws \InvalidArgumentException
|
||||
* @throws GenericShareException
|
||||
* @throws HintException
|
||||
*/
|
||||
public function updateShare(IShare $share, bool $onlyValid = true) {
|
||||
$expirationDateUpdated = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue