Exemplo n.º 1
0
 /**
  * Calculate the number of remaining attempts.
  *
  * @param  string  $key
  * @param  int  $maxAttempts
  * @param  int|null  $retryAfter
  * @return int
  */
 protected function calculateRemainingAttempts($key, $maxAttempts, $retryAfter = null)
 {
     if (!is_null($retryAfter)) {
         return 0;
     }
     return $this->limiter->retriesLeft($key, $maxAttempts);
 }
Exemplo n.º 2
0
 /**
  * Determine how many retries left.
  *
  * @return int
  */
 public function retriesLeft()
 {
     return $this->cacheLimiter->retriesLeft($this->getUniqueLoginKey(), $this->maxLoginAttempts());
 }