From bf22bb914327bb0e03be173d461cebed386a3dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Mon, 19 Feb 2024 17:47:58 +0100 Subject: [PATCH] Enforce authentication for payment methods --- app/Livewire/BillingPortal/Payments/Methods.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Livewire/BillingPortal/Payments/Methods.php b/app/Livewire/BillingPortal/Payments/Methods.php index e5e969a9c5ef..c742dac5ee3a 100644 --- a/app/Livewire/BillingPortal/Payments/Methods.php +++ b/app/Livewire/BillingPortal/Payments/Methods.php @@ -12,6 +12,7 @@ namespace App\Livewire\BillingPortal\Payments; +use App\Livewire\BillingPortal\Authentication; use Livewire\Component; use App\Models\Subscription; use Illuminate\Support\Facades\Cache; @@ -26,6 +27,12 @@ class Methods extends Component public function mount(): void { + if (auth()->guard('contact')->guest()) { + $this->dispatch('purchase.forward', component: Authentication::class); + + return; + } + $total = collect($this->context['products'])->sum('total_raw'); $methods = auth()->guard('contact')->user()->client->service()->getPaymentMethods(