From cd2cbadd40659d300dfe5d2cdbeb18015c829c38 Mon Sep 17 00:00:00 2001 From: erichester76 Date: Mon, 18 May 2020 19:53:07 -0400 Subject: [PATCH] fixed bug with contact and authed user clash (#3685) If a contact key is set and a user is also logged in. this was causing the account id to be set to that of the contact, not the authed user. broke multi-account setups. --- app/Http/Requests/EntityRequest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Requests/EntityRequest.php b/app/Http/Requests/EntityRequest.php index 51fb5f9ec363..90d94819707d 100644 --- a/app/Http/Requests/EntityRequest.php +++ b/app/Http/Requests/EntityRequest.php @@ -49,8 +49,10 @@ class EntityRequest extends Request //Support Client Portal Scopes $accountId = false; - - if(Input::get('account_id')) + + if($this->user()->account_id) + $accountId = $this->user()->account_id; + elseif(Input::get('account_id')) $accountId = Input::get('account_id'); elseif($contact = Contact::getContactIfLoggedIn()) $accountId = $contact->account->id;