From 59e032f88357c244855777eef0b608d66e86a239 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 6 Apr 2022 14:52:07 +1000 Subject: [PATCH] Handle user not present in completePurchase method of subscriptions --- app/Services/Subscription/SubscriptionService.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Services/Subscription/SubscriptionService.php b/app/Services/Subscription/SubscriptionService.php index 9899e94f2259..04e2541df9be 100644 --- a/app/Services/Subscription/SubscriptionService.php +++ b/app/Services/Subscription/SubscriptionService.php @@ -121,7 +121,10 @@ class SubscriptionService //execute any webhooks $this->triggerWebhook($context); - $this->handleRedirect('/client/invoices/'.$this->encodePrimaryKey($payment_hash->fee_invoice_id)); + /* 06-04-2022 */ + /* We may not be in a state where the user is present */ + if(auth()->guard('contact')) + $this->handleRedirect('/client/invoices/'.$this->encodePrimaryKey($payment_hash->fee_invoice_id)); } }