public function resetPassword($password, $token)
    {
        if (!$this->validatePasswordResetToken($token)) {
            return false;
        }
        $this->trigger(static::$eventBeforeResetPassword);
        $this->password = $password;
        $this->setPasswordResetToken();
        if (!$this->save()) {
            $this->trigger(static::$eventResetPasswordFailed);
            return false;
        }
        $this->trigger(static::$eventAfterResetPassword);
        return true;
    }
public function resetPassword($password, $token)
    {
        if (!$this->validatePasswordResetToken($token)) {
            return false;
        }
        $this->trigger(static::$eventBeforeResetPassword);
        $this->password = $password;
        $this->setPasswordResetToken();
        if (!$this->save()) {
            $this->trigger(static::$eventResetPasswordFailed);
            return false;
        }
        $this->trigger(static::$eventAfterResetPassword);
        return true;
    }
public function resetPassword ( $ password , $ token ) { if ( ! $ this -> validatePasswordResetToken ( $ token ) ) { return false ; } $ this -> trigger ( static :: $ eventBeforeResetPassword ) ; $ this -> password = $ password ; $ this -> setPasswordResetToken ( ) ; if ( ! $ this -> save ( ) ) { $ this -> trigger ( static :: $ eventResetPasswordFailed ) ; return false ; } $ this -> trigger ( static :: $ eventAfterResetPassword ) ; return true ; }
Reset password with password reset token.
It will validate password reset token, before reseting password.
@param string $password New password to be reset.
@param string $token Password reset token.
@return boolean whether reset password successfully or not.
Reset password with password reset token . It will validate password reset token before reseting password .