Skip to content
Snippets Groups Projects

#3435020 Convert PasswordConstraint plugins to attributes

All threads resolved!
All threads resolved!
Files
10
@@ -3,6 +3,8 @@
namespace Drupal\password_policy_blacklist\Plugin\PasswordConstraint;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\password_policy\Attribute\PasswordConstraint;
use Drupal\password_policy\PasswordConstraintBase;
use Drupal\password_policy\PasswordPolicyValidation;
@@ -16,6 +18,12 @@ use Drupal\password_policy\PasswordPolicyValidation;
* error_message = @Translation("Your password contains restricted words or phrases.")
* )
*/
#[PasswordConstraint(
id: "password_blacklist",
title: new TranslatableMarkup("Password Blacklist"),
description: new TranslatableMarkup("Password cannot match certain disallowed passwords"),
errorMessage: new TranslatableMarkup("Your password contains restricted words or phrases."),
)]
class PasswordBlacklist extends PasswordConstraintBase {
/**
Loading