protected function renderToken(UserInterface $user, $statusCode = 200)
    {
        $body = [
            'token'         => $this->container->get('lexik_jwt_authentication.jwt_manager')->create($user),
            'refresh_token' => $this->attachRefreshToken($user),
            'user'          => $user->getUsername(),
        ];

        return new JsonResponse($body, $statusCode);
    }