public function resetPassword($password)
    {
        $hashedPassword = Yii::$app->security->generatePasswordHash($password);
        $usedPassword = new UserUsedPassword();
        $usedPassword->setAttributes([
            'user_id' => $this->id,
            'password' => $hashedPassword,
            'set_on' => date('Y-m-d H:i:s'),
        ], false);
        $this->setAttributes([
            'password' => $hashedPassword,
            'password_set_on' => date('Y-m-d H:i:s'),
        ], false);

        return $usedPassword->save() && $this->save();
    }