From 76a78405b1fce166442a8beb6a81cc3b39937fd1 Mon Sep 17 00:00:00 2001 From: Chirag Chhatrala Date: Tue, 10 Dec 2024 20:12:35 +0530 Subject: [PATCH] ignore register throttle for testing env --- api/app/Http/Controllers/Auth/RegisterController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/app/Http/Controllers/Auth/RegisterController.php b/api/app/Http/Controllers/Auth/RegisterController.php index 0731af4c1..badd5cc58 100644 --- a/api/app/Http/Controllers/Auth/RegisterController.php +++ b/api/app/Http/Controllers/Auth/RegisterController.php @@ -28,8 +28,10 @@ class RegisterController extends Controller public function __construct() { $this->middleware('guest'); - $this->middleware('throttle:5,1')->only('register'); // 5 attempts per minute - $this->middleware('throttle:30,60')->only('register'); // 30 attempts per hour + if (app()->environment() !== 'testing') { + $this->middleware('throttle:5,1')->only('register'); // 5 attempts per minute + $this->middleware('throttle:30,60')->only('register'); // 30 attempts per hour + } } /**