From 00dced2c24a030333b75b196e4dcf19ecc8e486d Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Sun, 4 Oct 2026 19:48:46 +0200 Subject: [PATCH] refactor(api): check HTTP basic auth request fields with one hasAny call --- app/Http/Controllers/Api/ApplicationsController.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Api/ApplicationsController.php b/app/Http/Controllers/Api/ApplicationsController.php index 1f6e9e6a11..d6d7821238 100644 --- a/app/Http/Controllers/Api/ApplicationsController.php +++ b/app/Http/Controllers/Api/ApplicationsController.php @@ -3349,10 +3349,15 @@ class ApplicationsController extends Controller ], 422); } - $requestHasHttpBasicAuth = $request->has('is_http_basic_auth_enabled') - || $request->has('http_basic_auth_username') - || $request->has('http_basic_auth_password') - || $request->hasAny(['http_basic_auth_hash_algorithm', 'http_basic_auth_bcrypt_cost', 'http_basic_auth_argon2id_memory_cost', 'http_basic_auth_argon2id_time_cost']); + $requestHasHttpBasicAuth = $request->hasAny([ + 'is_http_basic_auth_enabled', + 'http_basic_auth_username', + 'http_basic_auth_password', + 'http_basic_auth_hash_algorithm', + 'http_basic_auth_bcrypt_cost', + 'http_basic_auth_argon2id_memory_cost', + 'http_basic_auth_argon2id_time_cost', + ]); if ($request->has('is_http_basic_auth_enabled') && $request->is_http_basic_auth_enabled === true) { if (blank($application->http_basic_auth_username) || blank($application->http_basic_auth_password)) {