From ab646751272c2b2aa9d7b44bab7cb0439f37eea3 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Mon, 21 Mar 2022 09:53:54 +0100 Subject: [PATCH] Fix stub tests --- src/Http/Livewire/LogoutOtherBrowserSessionsForm.php | 4 ++++ src/Http/Livewire/UpdatePasswordForm.php | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Http/Livewire/LogoutOtherBrowserSessionsForm.php b/src/Http/Livewire/LogoutOtherBrowserSessionsForm.php index ab4c317f7..7ee6afc04 100644 --- a/src/Http/Livewire/LogoutOtherBrowserSessionsForm.php +++ b/src/Http/Livewire/LogoutOtherBrowserSessionsForm.php @@ -49,6 +49,10 @@ public function confirmLogout() */ public function logoutOtherBrowserSessions(StatefulGuard $guard) { + if (config('session.driver') !== 'database') { + return; + } + $this->resetErrorBag(); if (! Hash::check($this->password, Auth::user()->password)) { diff --git a/src/Http/Livewire/UpdatePasswordForm.php b/src/Http/Livewire/UpdatePasswordForm.php index 3bb1741ec..d894bd969 100644 --- a/src/Http/Livewire/UpdatePasswordForm.php +++ b/src/Http/Livewire/UpdatePasswordForm.php @@ -31,9 +31,11 @@ public function updatePassword(UpdatesUserPasswords $updater) $updater->update(Auth::user(), $this->state); - request()->session()->put([ - 'password_hash_'.Auth::getDefaultDriver() => Auth::user()->getAuthPassword(), - ]); + if (request()->hasSession()) { + request()->session()->put([ + 'password_hash_'.Auth::getDefaultDriver() => Auth::user()->getAuthPassword(), + ]); + } $this->state = [ 'current_password' => '',