public function registerAction()
    {
        $userIdentityField = $this->container->getParameter('rch_jwt_user.user_identity_field');
        $userManager = $this->container->get('fos_user.user_manager');
        $userClass = $userManager->getClass();

        $rules = [
            $userIdentityField => [
                'requirements' => ['email' == $userIdentityField ? new Email() : '[^/]+'],
            ],
            'password' => ['requirements' => '[^/]+'],
        ];

        $params = $this->get('rch_jwt_user.credential_fetcher')
            ->create($rules)
            ->all();

        $user = $this->createUser($params, $userManager);

        return $this->renderToken($user, 201);
    }
public function registerAction()
    {
        $userIdentityField = $this->container->getParameter('rch_jwt_user.user_identity_field');
        $userManager = $this->container->get('fos_user.user_manager');
        $userClass = $userManager->getClass();

        $rules = [
            $userIdentityField => [
                'requirements' => ['email' == $userIdentityField ? new Email() : '[^/]+'],
            ],
            'password' => ['requirements' => '[^/]+'],
        ];

        $params = $this->get('rch_jwt_user.credential_fetcher')
            ->create($rules)
            ->all();

        $user = $this->createUser($params, $userManager);

        return $this->renderToken($user, 201);
    }
public function registerAction ( ) { $ userIdentityField = $ this -> container -> getParameter ( 'rch_jwt_user.user_identity_field' ) ; $ userManager = $ this -> container -> get ( 'fos_user.user_manager' ) ; $ userClass = $ userManager -> getClass ( ) ; $ rules = [ $ userIdentityField => [ 'requirements' => [ 'email' == $ userIdentityField ? new Email ( ) : '[^/]+' ] , ] , 'password' => [ 'requirements' => '[^/]+' ] , ] ; $ params = $ this -> get ( 'rch_jwt_user.credential_fetcher' ) -> create ( $ rules ) -> all ( ) ; $ user = $ this -> createUser ( $ params , $ userManager ) ; return $ this -> renderToken ( $ user , 201 ) ; }
Register a new User and authenticate it.

Required request parameters: %user_identity_field% (configured), password

@return object The authentication token
Register a new User and authenticate it .