Currently five login attempts blocks user for 1 minute and its working fine with the following code :
if ($this->hasTooManyLoginAttempts($request)) {
$this->fireLockoutEvent($request);
return $this->sendLockoutResponse($request);
}
What i want is that, When a user gets unblocked again after the first attempts, On the second attempts the block time should increase to 3 minutes.
I searched around, But could not found anything, Is there any way around it ?
I think you need to set property in LoginController:
Also you can controll numbers of attempts:
For more information you can investigate: trait AuthenticatesUsers - which has method "login" and code from your description. And this trait uses another trait: "ThrottlesLogins" -> this traits has method named "decayMinutes". It returns number of minutes.
Hope it will help you!
I would suggest you try the following code. Please ask if anything is unclear.
Code for incremental blocking:
Code for incremental blocking with cache:
I think laravel default doesn't provide what your need, So you need to save in (cache, session or database) if user had blocked once on your own, and increase
decayMinutes
as you want.