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
dab953970d
commit
ca1e3828aa
1 changed files with 7 additions and 1 deletions
|
|
@ -110,7 +110,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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -768,6 +773,7 @@ class Manager implements IManager {
|
|||
* @param IShare $share
|
||||
* @return IShare The share object
|
||||
* @throws \InvalidArgumentException
|
||||
* @throws HintException
|
||||
*/
|
||||
public function updateShare(IShare $share) {
|
||||
$expirationDateUpdated = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue