Do not force delete tokens when logging out

This commit is contained in:
David Bomba 2024-03-15 09:08:44 +11:00
parent 8f07aa7769
commit 0186368f39
2 changed files with 8 additions and 3 deletions

View File

@ -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);
}
}

View File

@ -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