aboutsummaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-08-28 15:50:45 +0200
committerJoas Schilling <coding@schilljs.com>2023-08-28 15:50:45 +0200
commit25309bcb45232bf30fe719bac1776f0136f7cd7a (patch)
tree7cfa6dacd42f22a854b895c2ae5853ff1725d96b /lib/base.php
parentac3d7e3a7e9848c5e134b79f481d73416cc810f4 (diff)
downloadnextcloud-server-25309bcb45232bf30fe719bac1776f0136f7cd7a.tar.gz
nextcloud-server-25309bcb45232bf30fe719bac1776f0136f7cd7a.zip
techdebt(DI): Use public IThrottler interface which exists since Nextcloud 25
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/base.php b/lib/base.php
index b328165fdfa..7153e481eda 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -74,6 +74,7 @@ use OCP\ILogger;
use OCP\IRequest;
use OCP\IURLGenerator;
use OCP\IUserSession;
+use OCP\Security\Bruteforce\IThrottler;
use OCP\Server;
use OCP\Share;
use OCP\User\Events\UserChangedEvent;
@@ -871,7 +872,7 @@ class OC {
// reset brute force delay for this IP address and username
$uid = $userSession->getUser()->getUID();
$request = Server::get(IRequest::class);
- $throttler = Server::get(\OC\Security\Bruteforce\Throttler::class);
+ $throttler = Server::get(IThrottler::class);
$throttler->resetDelay($request->getRemoteAddress(), 'login', ['user' => $uid]);
}
@@ -1149,7 +1150,7 @@ class OC {
&& $userSession->loginWithCookie($_COOKIE['nc_username'], $_COOKIE['nc_token'], $_COOKIE['nc_session_id'])) {
return true;
}
- if ($userSession->tryBasicAuthLogin($request, Server::get(\OC\Security\Bruteforce\Throttler::class))) {
+ if ($userSession->tryBasicAuthLogin($request, Server::get(IThrottler::class))) {
return true;
}
return false;