code: public function createService(ServiceLocatorInterface $serviceLocator)
      {
          $services = $serviceLocator->getServiceLocator();
          /* @var $options ControllerOptionsInterface */
          $options = $services->get(ModuleOptions::class);
  
          if ($options instanceof FormCommonOptionsInterface) {
              $formOptions = $options->toArray();
          } else {
              $formOptions = [];
          }
  
          if (!isset($formOptions['use_reset_element'])) {
              $formOptions['use_reset_element'] = true;
          }
  
          return new AuthenticationController(
              $services->get('DomainServiceManager')->get($options->getUserEntityClass()),
              $options,
              $services->get('FormElementManager')->get(ResetPassword::class, $formOptions)
          );
      }
docs: {@inheritDoc}
  
  @return AuthenticationController