Laravel prevent the user from login for 30 seconds after 3 failed login

Viewed 315

using passport for authentication and also integrated the hasTooManyLoginAttempts() to prevent too many login attempts. But the problem is I just need the specify a 30 seconds delay instead of minutes.

protected $maxAttempts = 3;
protected $decayMinutes = (30/60);

if ($this->hasTooManyLoginAttempts($request)){
            $this->fireLockoutEvent($request);
            $seconds = $this->limiter()->availableIn(
                $this->throttleKey($request)
            );
            return response()->json([
                'status'                => false,
                'message'               => "Too many failed login attempts. Your account has been locked.",
                'delay'                 => $seconds
            ],$this->validationStatus); 
        }

Can you please help me. Thank you.

0 Answers
Related