3434 */
3535class RestAuthenticator implements AuthenticatorInterface
3636{
37- private const DEFAULT_MIN_SLEEP_VALUE = 30000 ;
38-
39- private const DEFAULT_MAX_SLEEP_VALUE = 500000 ;
40-
4137 /**
4238 * @var \Psr\Log\LoggerInterface
4339 */
@@ -72,34 +68,20 @@ class RestAuthenticator implements AuthenticatorInterface
7268 */
7369 private $ logoutHandlers = [];
7470
75- /**
76- * @var int|null
77- */
78- private $ minSleepTime ;
79-
80- /**
81- * @var int|null
82- */
83- private $ maxSleepTime ;
84-
8571 public function __construct (
8672 TokenStorageInterface $ tokenStorage ,
8773 AuthenticationManagerInterface $ authenticationManager ,
8874 $ providerKey ,
8975 EventDispatcherInterface $ dispatcher ,
9076 ConfigResolverInterface $ configResolver ,
91- LoggerInterface $ logger = null ,
92- $ minSleepTime = self ::DEFAULT_MIN_SLEEP_VALUE ,
93- $ maxSleepTime = self ::DEFAULT_MAX_SLEEP_VALUE
77+ LoggerInterface $ logger = null
9478 ) {
9579 $ this ->tokenStorage = $ tokenStorage ;
9680 $ this ->authenticationManager = $ authenticationManager ;
9781 $ this ->providerKey = $ providerKey ;
9882 $ this ->dispatcher = $ dispatcher ;
9983 $ this ->configResolver = $ configResolver ;
10084 $ this ->logger = $ logger ;
101- $ this ->minSleepTime = !is_int ($ minSleepTime ) ? self ::DEFAULT_MIN_SLEEP_VALUE : $ minSleepTime ;
102- $ this ->maxSleepTime = !is_int ($ maxSleepTime ) ? self ::DEFAULT_MAX_SLEEP_VALUE : $ maxSleepTime ;
10385 }
10486
10587 /**
@@ -114,8 +96,6 @@ public function __invoke(RequestEvent $event)
11496
11597 public function authenticate (Request $ request )
11698 {
117- usleep (random_int ($ this ->minSleepTime , $ this ->maxSleepTime ));
118-
11999 // If a token already exists and username is the same as the one we request authentication for,
120100 // then return it and mark it as coming from session.
121101 $ previousToken = $ this ->tokenStorage ->getToken ();
0 commit comments