Merge pull request #5276 from beganovich/v5-2903-fix-contact-initialization

(v5) Fix contact initalization for billing page
This commit is contained in:
Benjamin Beganović 2021-03-29 12:26:01 +02:00 committed by GitHub
commit c2406563ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -217,6 +217,10 @@ class BillingPortalPurchase extends Component
*/ */
protected function getPaymentMethods(ClientContact $contact): self protected function getPaymentMethods(ClientContact $contact): self
{ {
Auth::guard('contact')->login($contact);
$this->contact = $contact;
if ($this->subscription->trial_enabled) { if ($this->subscription->trial_enabled) {
$this->heading_text = ctrans('texts.plan_trial'); $this->heading_text = ctrans('texts.plan_trial');
$this->steps['show_start_trial'] = true; $this->steps['show_start_trial'] = true;
@ -230,10 +234,6 @@ class BillingPortalPurchase extends Component
$this->heading_text = ctrans('texts.payment_methods'); $this->heading_text = ctrans('texts.payment_methods');
Auth::guard('contact')->login($contact);
$this->contact = $contact;
return $this; return $this;
} }