code: public function userDataEncodePassword(&$userData, Password $newPassword)
      {
          $encoderName = $this->config["encoder"];
          $encoder = $this->picoAuth->getContainer()->get($encoderName);
  
          $userData['pwhash'] = $encoder->encode($newPassword->get());
          $userData['encoder'] = $encoderName;
          if (isset($userData['pwreset'])) {
              unset($userData['pwreset']);
          }
      }
docs: Fills user-data array with the encoded password
  
  @param array $userData User data array
  @param Password $newPassword The password to be encoded