setNewPassword
The setNewPassword hook is triggered after a new password has been set. It
passes the user object and the encrypted password as arguments and does not
expect a return value.
Parameters
object
$memberCurrent front end user (either
\Contao\Database\Resultor\Contao\MemberModel) that changed their password.string
$passwordThe new password (encrypted).
\Contao\Module
$moduleCalling front end module. Will be
nullin back end context.
Example
// src/EventListener/SetNewPasswordListener.php
namespace App\EventListener;
use Contao\CoreBundle\DependencyInjection\Attribute\AsHook;
use Contao\Module;
#[AsHook('setNewPassword')]
class SetNewPasswordListener
{
public function __invoke($member, string $password, Module $module = null): void
{
// Do something …
}
}