Merge pull request #41177 from nextcloud/fix/noid/reset-bfp-on-sudo-action

Reset BFP for sudo action
This commit is contained in:
Joas Schilling 2023-10-30 14:27:36 +01:00 committed by GitHub
commit f72ec9e246
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -360,12 +360,13 @@ class LoginController extends Controller {
$loginResult = $this->userManager->checkPassword($loginName, $password);
if ($loginResult === false) {
$response = new DataResponse([], Http::STATUS_FORBIDDEN);
$response->throttle();
$response->throttle(['loginName' => $loginName]);
return $response;
}
$confirmTimestamp = time();
$this->session->set('last-password-confirm', $confirmTimestamp);
$this->throttler->resetDelay($this->request->getRemoteAddress(), 'sudo', ['loginName' => $loginName]);
return new DataResponse(['lastLogin' => $confirmTimestamp], Http::STATUS_OK);
}
}