diff --git a/app/Http/Controllers/LogoutController.php b/app/Http/Controllers/LogoutController.php index 2889b777d0dd..423a382e71e1 100644 --- a/app/Http/Controllers/LogoutController.php +++ b/app/Http/Controllers/LogoutController.php @@ -63,8 +63,12 @@ class LogoutController extends BaseController $ct->company ->tokens() ->where('is_system', true) - ->forceDelete(); - + ->cursor() + ->each(function ($ct){ + $ct->token = \Illuminate\Support\Str::random(64); + $ct->save(); + }); + return response()->json(['message' => 'All tokens deleted'], 200); } } diff --git a/app/Livewire/RequiredClientInfo.php b/app/Livewire/RequiredClientInfo.php index 733f9a0b4559..c661bbcb8c53 100644 --- a/app/Livewire/RequiredClientInfo.php +++ b/app/Livewire/RequiredClientInfo.php @@ -222,8 +222,9 @@ class RequiredClientInfo extends Component $this->show_form = true; $hash = Cache::get(request()->input('hash')); + $invoice = Invoice::find($this->decodePrimaryKey($hash['invoice_id'])); - $this->invoice_terms = Invoice::find($this->decodePrimaryKey($hash['invoice_id']))->terms; + $this->invoice_terms = $invoice->terms; } count($this->fields) > 0 || $this->show_terms