fix: Only throttle on invalid requests for public share links

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2023-11-28 19:43:48 +01:00
parent 9c937a311d
commit 9642615f52
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF

View file

@ -77,6 +77,8 @@ class PublicShareMiddleware extends Middleware {
$controller->setToken($token);
if (!$controller->isValidToken()) {
$this->throttle($bruteforceProtectionAction, $token);
$controller->shareNotFound();
throw new NotFoundException();
}
@ -88,7 +90,6 @@ class PublicShareMiddleware extends Middleware {
// If authentication succeeds just continue
if ($controller->isAuthenticated()) {
$this->throttle($bruteforceProtectionAction, $token);
return;
}