src/Security/MemberAuthenticator/LostPasswordHandler.php
public function forgotPassword($data, $form)
    {
        // Run a first pass validation check on the data
        $dataValidation = $this->validateForgotPasswordData($data, $form);
        if ($dataValidation instanceof HTTPResponse) {
            return $dataValidation;
        }

        /** @var Member $member */
        $member = $this->getMemberFromData($data);

        // Allow vetoing forgot password requests
        $results = $this->extend('forgotPassword', $member);
        if ($results && is_array($results) && in_array(false, $results, true)) {
            return $this->redirectToLostPassword();
        }

        if ($member) {
            $token = $member->generateAutologinTokenAndStoreHash();

            $this->sendEmail($member, $token);
        }

        return $this->redirectToSuccess($data);
    }
public function forgotPassword($data, $form)
    {
        // Run a first pass validation check on the data
        $dataValidation = $this->validateForgotPasswordData($data, $form);
        if ($dataValidation instanceof HTTPResponse) {
            return $dataValidation;
        }

        /** @var Member $member */
        $member = $this->getMemberFromData($data);

        // Allow vetoing forgot password requests
        $results = $this->extend('forgotPassword', $member);
        if ($results && is_array($results) && in_array(false, $results, true)) {
            return $this->redirectToLostPassword();
        }

        if ($member) {
            $token = $member->generateAutologinTokenAndStoreHash();

            $this->sendEmail($member, $token);
        }

        return $this->redirectToSuccess($data);
    }
public function forgotPassword ( $ data , $ form ) { // Run a first pass validation check on the data $ dataValidation = $ this -> validateForgotPasswordData ( $ data , $ form ) ; if ( $ dataValidation instanceof HTTPResponse ) { return $ dataValidation ; } /** @var Member $member */ $ member = $ this -> getMemberFromData ( $ data ) ; // Allow vetoing forgot password requests $ results = $ this -> extend ( 'forgotPassword' , $ member ) ; if ( $ results && is_array ( $ results ) && in_array ( false , $ results , true ) ) { return $ this -> redirectToLostPassword ( ) ; } if ( $ member ) { $ token = $ member -> generateAutologinTokenAndStoreHash ( ) ; $ this -> sendEmail ( $ member , $ token ) ; } return $ this -> redirectToSuccess ( $ data ) ; }
Forgot password form handler method.
Called when the user clicks on "I've lost my password".
Extensions can use the 'forgotPassword' method to veto executing
the logic, by returning FALSE. In this case, the user will be redirected back
to the form without further action. It is recommended to set a message
in the form detailing why the action was denied.

@skipUpgrade
@param array $data Submitted data
@param LostPasswordForm $form
@return HTTPResponse
Forgot password form handler method . Called when the user clicks on I ve lost my password . Extensions can use the forgotPassword method to veto executing the logic by returning FALSE . In this case the user will be redirected back to the form without further action . It is recommended to set a message in the form detailing why the action was denied .