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);
    }
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);
    }
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 ) ; }
Generates a JWT from given User.

@param UserInterface $user
@param int           $statusCode

@return array Response body containing the User and its tokens
Generates a JWT from given User .