From db391d96c53dbe1d83fca75c9f22ac713191914c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Thu, 21 Mar 2024 16:19:35 +0100 Subject: [PATCH] Make sure we force at least one of auth methods --- app/Services/Subscription/StepService.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Services/Subscription/StepService.php b/app/Services/Subscription/StepService.php index 25d4027df5b6..84ed67ecf965 100644 --- a/app/Services/Subscription/StepService.php +++ b/app/Services/Subscription/StepService.php @@ -49,6 +49,15 @@ class StepService } } + $auth = collect($dependencies) + ->filter(fn ($dependency) => str_starts_with($dependency['id'], 'auth.')) + ->keys() + ->toArray(); + + if (count(array_intersect($auth, $steps)) === 0) { + $errors[] = ctrans('texts.step_authentication_fail'); + } + return $errors; }