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
$member
Current front end user (either
\Contao\Database\Result
or\Contao\MemberModel
) that changed their password.string
$password
The new password (encrypted).
\Contao\Module
$module
Calling front end module. Will be
null
in 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 …
}
}