1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Fixes for subscriptions - ensure client authentication is against correct company

This commit is contained in:
David Bomba 2022-02-02 08:42:48 +11:00
parent 43d9773fae
commit a0ae3061c1

View File

@ -24,6 +24,12 @@ class SubscriptionPurchaseController extends Controller
{ {
public function index(Subscription $subscription, Request $request) public function index(Subscription $subscription, Request $request)
{ {
/* Make sure the contact is logged into the correct company for this subscription */
if(auth()->guard('contact')->user() && auth()->guard('contact')->user()->company_id != $subscription->company_id){
auth()->guard('contact')->logout();
$request->session()->invalidate();
}
if ($request->has('locale')) { if ($request->has('locale')) {
$this->setLocale($request->query('locale')); $this->setLocale($request->query('locale'));
} }