public function requestRememberPasswordAction(Request $request, $userClass)
    {
        $form = $this->get('form.factory')->createNamedBuilder('', RequestRememberPasswordType::class, null, [
            'csrf_protection' => false,
        ])->getForm();

        $form->handleRequest($request);
        if ($form->isValid()) {
            try {
                $this->get('bengor_user.' . $userClass . '.api_command_bus')->handle(
                    $form->getData()
                );

                return new JsonResponse();
            } catch (UserDoesNotExistException $exception) {
                return new JsonResponse(
                    sprintf(
                        'The "%s" user email does not exist ',
                        $form->getData()->email()
                    ),
                    400
                );
            }
        }

        return new JsonResponse(FormErrorSerializer::errors($form), 400);
    }
public function requestRememberPasswordAction(Request $request, $userClass)
    {
        $form = $this->get('form.factory')->createNamedBuilder('', RequestRememberPasswordType::class, null, [
            'csrf_protection' => false,
        ])->getForm();

        $form->handleRequest($request);
        if ($form->isValid()) {
            try {
                $this->get('bengor_user.' . $userClass . '.api_command_bus')->handle(
                    $form->getData()
                );

                return new JsonResponse();
            } catch (UserDoesNotExistException $exception) {
                return new JsonResponse(
                    sprintf(
                        'The "%s" user email does not exist ',
                        $form->getData()->email()
                    ),
                    400
                );
            }
        }

        return new JsonResponse(FormErrorSerializer::errors($form), 400);
    }
public function requestRememberPasswordAction ( Request $ request , $ userClass ) { $ form = $ this -> get ( 'form.factory' ) -> createNamedBuilder ( '' , RequestRememberPasswordType :: class , null , [ 'csrf_protection' => false , ] ) -> getForm ( ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isValid ( ) ) { try { $ this -> get ( 'bengor_user.' . $ userClass . '.api_command_bus' ) -> handle ( $ form -> getData ( ) ) ; return new JsonResponse ( ) ; } catch ( UserDoesNotExistException $ exception ) { return new JsonResponse ( sprintf ( 'The "%s" user email does not exist ' , $ form -> getData ( ) -> email ( ) ) , 400 ) ; } } return new JsonResponse ( FormErrorSerializer :: errors ( $ form ) , 400 ) ; }
Request remember user password action.

@param Request $request   The request
@param string  $userClass Extra parameter that contains the user type

@return \Symfony\Component\HttpFoundation\JsonResponse
Request remember user password action .