Merge "Upgrade phan config to 0.7.1"
[lhc/web/wiklou.git] / includes / auth / ThrottlePreAuthenticationProvider.php
index 3f6a47d..83d67ea 100644 (file)
@@ -58,8 +58,7 @@ class ThrottlePreAuthenticationProvider extends AbstractPreAuthenticationProvide
        public function __construct( $params = [] ) {
                $this->throttleSettings = array_intersect_key( $params,
                        [ 'accountCreationThrottle' => true, 'passwordAttemptThrottle' => true ] );
-               $this->cache = isset( $params['cache'] ) ? $params['cache'] :
-                       \ObjectCache::getLocalClusterInstance();
+               $this->cache = $params['cache'] ?? \ObjectCache::getLocalClusterInstance();
        }
 
        public function setConfig( Config $config ) {
@@ -167,7 +166,9 @@ class ThrottlePreAuthenticationProvider extends AbstractPreAuthenticationProvide
 
                $data = $this->manager->getAuthenticationSessionData( 'LoginThrottle' );
                if ( !$data ) {
-                       $this->logger->error( 'throttler data not found for {user}', [ 'user' => $user->getName() ] );
+                       // this can occur when login is happening via AuthenticationRequest::$loginRequest
+                       // so testForAuthentication is skipped
+                       $this->logger->info( 'throttler data not found for {user}', [ 'user' => $user->getName() ] );
                        return;
                }