!auth()->check()

This commit is contained in:
HolgerHatGarKeineNode
2023-03-28 13:23:31 +02:00
parent 4534a57c02
commit 885bfeb143

View File

@@ -58,6 +58,9 @@ class OrangePillForm extends Component
public function save() public function save()
{ {
if (!auth()->check()) {
return to_route('auth.ln');
}
$this->validate(); $this->validate();
$this->orangePill->save(); $this->orangePill->save();
@@ -74,7 +77,9 @@ class OrangePillForm extends Component
public function deleteMe() public function deleteMe()
{ {
$this->orangePill->delete(); $this->orangePill->delete();
auth()->user()->undoPoint(new BookCaseOrangePilled(auth()->user())); auth()
->user()
->undoPoint(new BookCaseOrangePilled(auth()->user()));
return redirect($this->fromUrl); return redirect($this->fromUrl);
} }