diff --git a/tests/Integration/Auth/RehashOnLogoutOtherDevicesTest.php b/tests/Integration/Auth/RehashOnLogoutOtherDevicesTest.php new file mode 100644 index 000000000000..8e704ff33345 --- /dev/null +++ b/tests/Integration/Auth/RehashOnLogoutOtherDevicesTest.php @@ -0,0 +1,46 @@ +post('logout', function (Request $request) { + auth()->logoutOtherDevices($request->input('password')); + + return response()->noContent(); + })->middleware(['web', 'auth']); + } + + public function testItRehashThePasswordUsingLogoutOtherDevices() + { + $this->withoutExceptionHandling(); + + $user = UserFactory::new()->create(); + + $password = $user->password; + + $this->actingAs($user); + + $this->post('logout', [ + 'password' => 'password', + ])->assertStatus(204); + + $user->refresh(); + + $this->assertNotSame($password, $user->password); + } +}