PasswordHasBeenResetEvent
New in version 14.0
It is possible to add custom business logic after a Backend user resets their password using the new PSR-14 event.
The event Password
is raised right after a backend user resets their password
and it has been hashed and persisted to the database.
The event contains the corresponding backend user UID.
Example
The corresponding event listener class:
EXT:my_extension/Classes/Backend/EventListener/MyEventListener.php
<?php
declare(strict_types=1);
namespace Vendor\MyPackage\Backend\EventListener;
use TYPO3\CMS\Backend\Authentication\Event\PasswordHasBeenResetEvent;
use TYPO3\CMS\Core\Attribute\AsEventListener;
final class PasswordHasBeenResetEventListener
{
#[AsEventListener('my-package/backend/password-has-been-reset')]
public function __invoke(PasswordHasBeenResetEvent $event): void
{
$userUid = $event->userId;
// Do something with the be_user UID
}
}