mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 22:34:31 -04:00
Constrain by company_id
This commit is contained in:
parent
a0211acc59
commit
c62b2bec7d
@ -181,14 +181,16 @@ class BillingPortalPurchase extends Component
|
|||||||
{
|
{
|
||||||
$this->validate();
|
$this->validate();
|
||||||
|
|
||||||
$contact = ClientContact::where('email', $this->email)->first();
|
$contact = ClientContact::where('email', $this->email)
|
||||||
|
->where('company_id', $this->subscription->company_id)
|
||||||
|
->first();
|
||||||
|
|
||||||
if ($contact && $this->steps['existing_user'] === false) {
|
if ($contact && $this->steps['existing_user'] === false) {
|
||||||
return $this->steps['existing_user'] = true;
|
return $this->steps['existing_user'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($contact && $this->steps['existing_user']) {
|
if ($contact && $this->steps['existing_user']) {
|
||||||
$attempt = Auth::guard('contact')->attempt(['email' => $this->email, 'password' => $this->password]);
|
$attempt = Auth::guard('contact')->attempt(['email' => $this->email, 'password' => $this->password, 'company_id' => $this->subscription->company_id]);
|
||||||
|
|
||||||
return $attempt
|
return $attempt
|
||||||
? $this->getPaymentMethods($contact)
|
? $this->getPaymentMethods($contact)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user