Skip to content

Commit aa19143

Browse files
committed
fix(sharing): Set correct password context for share password validation
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent e0c1ea2 commit aa19143

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/private/Share20/Manager.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
use OCP\Security\Events\ValidatePasswordPolicyEvent;
3636
use OCP\Security\IHasher;
3737
use OCP\Security\ISecureRandom;
38+
use OCP\Security\PasswordContext;
3839
use OCP\Share;
3940
use OCP\Share\Events\BeforeShareDeletedEvent;
4041
use OCP\Share\Events\ShareAcceptedEvent;
@@ -116,7 +117,8 @@ protected function verifyPassword($password) {
116117

117118
// Let others verify the password
118119
try {
119-
$this->dispatcher->dispatchTyped(new ValidatePasswordPolicyEvent($password));
120+
$event = new ValidatePasswordPolicyEvent($password, PasswordContext::SHARING);
121+
$this->dispatcher->dispatchTyped($event);
120122
} catch (HintException $e) {
121123
/* Wrap in a 400 bad request error */
122124
throw new HintException($e->getMessage(), $e->getHint(), 400, $e);

0 commit comments

Comments
 (0)