Verified Commit d09b55c5 authored by Dave Long's avatar Dave Long
Browse files

Issue #3425342 by alexpott: Optimize...

Issue #3425342 by alexpott: Optimize \Drupal\basic_auth\Authentication\Provider\BasicAuth::authenticate()

(cherry picked from commit b6bee80d)
parent c3ceee3d
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -107,10 +107,10 @@ public function authenticate(Request $request) {
        // Don't allow login if the limit for this user has been reached.
        // Default is to allow 5 failed attempts every 6 hours.
        if ($this->flood->isAllowed('basic_auth.failed_login_user', $flood_config->get('user_limit'), $flood_config->get('user_window'), $identifier)) {
          $uid = $this->userAuth->authenticate($username, $password);
          $uid = $this->userAuth->authenticateAccount($account, $password);
          if ($uid) {
            $this->flood->clear('basic_auth.failed_login_user', $identifier);
            return $this->entityTypeManager->getStorage('user')->load($uid);
            return $account;
          }
          else {
            // Register a per-user failed login event.