From 24b2107c48d2dacacf99f9ab8239849bfcd7ab13 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Thu, 19 Jul 2018 10:45:06 +0800 Subject: [PATCH] Fix processing cookies after deleting user --- app/Http/Controllers/UserController.php | 4 +--- tests/UserControllerTest.php | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 6ad3d4a8..f60333b6 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -187,9 +187,7 @@ class UserController extends Controller ->json([ 'errno' => 0, 'msg' => trans('user.profile.delete.success') - ]) - ->cookie('uid', '', time() - 3600, '/') - ->cookie('token', '', time() - 3600, '/'); + ]); } break; // @codeCoverageIgnore diff --git a/tests/UserControllerTest.php b/tests/UserControllerTest.php index 56bf3609..9ef12085 100644 --- a/tests/UserControllerTest.php +++ b/tests/UserControllerTest.php @@ -385,8 +385,7 @@ class UserControllerTest extends TestCase ])->assertJson([ 'errno' => 0, 'msg' => trans('user.profile.delete.success') - ])->assertCookie('uid', '') - ->assertCookie('token', ''); + ]); $this->assertNull(User::find($user->uid)); }