You are here

public function TfaRecoveryCode::__construct in Two-factor Authentication (TFA) 8

Constructs a new Tfa plugin object.

Parameters

array $configuration: The plugin configuration.

string $plugin_id: The plugin id.

mixed $plugin_definition: The plugin definition.

\Drupal\user\UserDataInterface $user_data: User data object to store user specific information.

\Drupal\encrypt\EncryptionProfileManagerInterface $encryption_profile_manager: Encryption profile manager.

\Drupal\encrypt\EncryptServiceInterface $encrypt_service: Encryption service.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The configuration factory.

Overrides TfaBasePlugin::__construct

File

src/Plugin/TfaValidation/TfaRecoveryCode.php, line 59

Class

TfaRecoveryCode
Recovery validation class for performing recovery codes validation.

Namespace

Drupal\tfa\Plugin\TfaValidation

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, UserDataInterface $user_data, EncryptionProfileManagerInterface $encryption_profile_manager, EncryptServiceInterface $encrypt_service, ConfigFactoryInterface $config_factory) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $user_data, $encryption_profile_manager, $encrypt_service);
  $codes_amount = $config_factory
    ->get('tfa.settings')
    ->get('validation_plugin_settings.tfa_recovery_code.recovery_codes_amount');
  if (!empty($codes_amount)) {
    $this->codeLimit = $codes_amount;
  }
}