luarsab's avatar

Token could not be parsed from the request. While Feature Test

Hello, i am writing feature test for laravel application, for now i try to test my logout api, and i get an error

                  Token could not be parsed from the request.
                   Failed asserting that 200 is identical to 500.

   My test --->

             	public function test_auth_user_can_logout()
        {
      	$user = User::factory()->create();
     	$this->actingAs($user);

    	$response = $this->post(route('logout'))
    	->assertStatus(200);
      }

my logout function in controller -->

        public function logout(): JsonResponse
     {
    	auth()->logout();
     	return response()->json('Successfully logged out!', 200);
      }

I use jwt by the way. Is this caused by jwt? Or am i writing it wrong? My app is Vue + Laravel, Vue in the independent folder, and Laravel in the independent folder. So my laravel has only api usage.

0 likes
2 replies

Please or to participate in this conversation.