From e190981f95e714e42e44b13a61fda4f5dc411065 Mon Sep 17 00:00:00 2001 From: inmanturbo <47095624+inmanturbo@users.noreply.github.com> Date: Wed, 7 Apr 2021 08:35:50 -0400 Subject: [PATCH] Check for session before attempting to invalidate (#750) * Check for session before attempting to invalidate * Fix formatting, missing a space * $request->hasSession() not $request->session --- src/Http/Livewire/DeleteUserForm.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Http/Livewire/DeleteUserForm.php b/src/Http/Livewire/DeleteUserForm.php index 301eb3fc9..4e28afa38 100644 --- a/src/Http/Livewire/DeleteUserForm.php +++ b/src/Http/Livewire/DeleteUserForm.php @@ -64,8 +64,10 @@ public function deleteUser(Request $request, DeletesUsers $deleter, StatefulGuar $auth->logout(); - $request->session()->invalidate(); - $request->session()->regenerateToken(); + if ($request->hasSession()) { + $request->session()->invalidate(); + $request->session()->regenerateToken(); + } return redirect('/'); }