TfaCommands.php in Two-factor Authentication (TFA) 8
File
src/Commands/TfaCommands.php
View source
<?php
namespace Drupal\tfa\Commands;
use Consolidation\AnnotatedCommand\CommandData;
use Drush\Commands\DrushCommands;
use Drush\Drupal\Commands\sql\SanitizePluginInterface;
use Symfony\Component\Console\Input\InputInterface;
class TfaCommands extends DrushCommands implements SanitizePluginInterface {
public function sanitize($result, CommandData $commandData) {
$sql = "DELETE FROM users_data WHERE LEFT(name, 4) = 'tfa_'";
\Drupal::service('database')
->query($sql);
$this
->logger()
->success('Removed recovery codes and other user-specific TFA data.');
}
public function messages(&$messages, InputInterface $input) {
return $messages[] = dt('Remove recovery codes and other user-specific TFA data.');
}
}