getParsedBody(); $token = $data->token ?? null; if (!$token || !is_string($token)) { throw new BadRequest("No `token`."); } $authentication = $this->authenticationFactory->create(); $response = ResponseComposer::empty(); try { $authentication->destroyAuthToken($token, $request, $response); } catch (NotFound) { return $response->writeBody(Json::encode(false)); } return $response->writeBody(Json::encode(true)); } }