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.


  1. object $member

    Current front end user (either \Contao\Database\Result or \Contao\MemberModel) that changed their password.

  2. string $password

    The new password (not encrypted).

  3. \Contao\Module $module

    Calling front end module. Will be null in back end context.


// src/EventListener/SetNewPasswordListener.php
namespace App\EventListener;

use Contao\CoreBundle\ServiceAnnotation\Hook;
use Contao\Module;

 * @Hook("setNewPassword")
class SetNewPasswordListener
    public function __invoke($member, string $password, Module $module = null): void
        // Do something …