mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixed issue with retrieving company key by adding Cache facade and using stored data for company key instead of token
This commit is contained in:
parent
1c93e7bd41
commit
647ac08e80
@ -15,6 +15,7 @@ namespace App\Http\Requests\GoCardless;
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Company;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class OAuthConnectRequest extends FormRequest
|
||||
{
|
||||
@ -35,12 +36,16 @@ class OAuthConnectRequest extends FormRequest
|
||||
|
||||
public function getCompany(): \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Builder|\App\Models\BaseModel
|
||||
{
|
||||
$data = Cache::get(
|
||||
key: $this->token,
|
||||
);
|
||||
|
||||
MultiDB::findAndSetDbByCompanyKey(
|
||||
$this->company_key,
|
||||
company_key: $data['company_key'],
|
||||
);
|
||||
|
||||
return Company::query()
|
||||
->where('company_key', $this->company_key)
|
||||
->where('company_key', $data['company_key'])
|
||||
->firstOrFail();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user