Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Http/Livewire/LogoutOtherBrowserSessionsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
8 changes: 5 additions & 3 deletions src/Http/Livewire/UpdatePasswordForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this test ever actually run now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the failing test (test_password_can_be_updated) wasn't asserting this part

Failing test

1) Tests\Feature\UpdatePasswordTest::test_password_can_be_updated
RuntimeException: Session store not set on request.

/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Http/Request.php:524
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/jetstream/src/Http/Livewire/UpdatePasswordForm.php:35
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Container/Util.php:41
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
/Users/driesvints/Sites/test-jetstream-tests/vendor/livewire/livewire/src/ComponentConcerns/HandlesActions.php:149
/Users/driesvints/Sites/test-jetstream-tests/vendor/livewire/livewire/src/HydrationMiddleware/PerformActionCalls.php:38
/Users/driesvints/Sites/test-jetstream-tests/vendor/livewire/livewire/src/LifecycleManager.php:89
/Users/driesvints/Sites/test-jetstream-tests/vendor/livewire/livewire/src/Connection/ConnectionHandler.php:13
/Users/driesvints/Sites/test-jetstream-tests/vendor/livewire/livewire/src/Controllers/HttpConnectionHandler.php:20
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:48
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Routing/Route.php:261
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Routing/Route.php:204
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Routing/Router.php:725
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:141
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:116
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Routing/Router.php:727
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Routing/Router.php:702
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Routing/Router.php:666
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Routing/Router.php:655
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:167
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:141
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:116
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:142
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:111
/Users/driesvints/Sites/test-jetstream-tests/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:509
/Users/driesvints/Sites/test-jetstream-tests/vendor/livewire/livewire/src/Testing/TestableLivewire.php:198
/Users/driesvints/Sites/test-jetstream-tests/vendor/livewire/livewire/src/Testing/MakesHttpRequestsWrapper.php:29
/Users/driesvints/Sites/test-jetstream-tests/vendor/livewire/livewire/src/Testing/TestableLivewire.php:199
/Users/driesvints/Sites/test-jetstream-tests/vendor/livewire/livewire/src/Testing/TestableLivewire.php:183
/Users/driesvints/Sites/test-jetstream-tests/vendor/livewire/livewire/src/Testing/Concerns/MakesCallsToComponent.php:143
/Users/driesvints/Sites/test-jetstream-tests/vendor/livewire/livewire/src/Testing/Concerns/MakesCallsToComponent.php:38
/Users/driesvints/Sites/test-jetstream-tests/vendor/livewire/livewire/src/Testing/Concerns/MakesCallsToComponent.php:32
/Users/driesvints/Sites/test-jetstream-tests/tests/Feature/UpdatePasswordTest.php:26

request()->session()->put([
'password_hash_'.Auth::getDefaultDriver() => Auth::user()->getAuthPassword(),
]);
}

$this->state = [
'current_password' => '',
Expand Down