diff --git a/lib/private/AppFramework/Middleware/PublicShare/PublicShareMiddleware.php b/lib/private/AppFramework/Middleware/PublicShare/PublicShareMiddleware.php index b39534ba0e80a..4a2cf51973ccd 100644 --- a/lib/private/AppFramework/Middleware/PublicShare/PublicShareMiddleware.php +++ b/lib/private/AppFramework/Middleware/PublicShare/PublicShareMiddleware.php @@ -77,6 +77,8 @@ public function beforeController($controller, $methodName) { $controller->setToken($token); if (!$controller->isValidToken()) { + $this->throttle($bruteforceProtectionAction, $token); + $controller->shareNotFound(); throw new NotFoundException(); } @@ -88,7 +90,6 @@ public function beforeController($controller, $methodName) { // If authentication succeeds just continue if ($controller->isAuthenticated()) { - $this->throttle($bruteforceProtectionAction, $token); return; }