index.js
function(action, channel, accountInfo, auth, next) {
    var self = this, config = this.getConfig();

    if (!next && 'function' === typeof auth) {
      next = auth;
    } else {
      if (self.isOAuth()) {
        if (!auth.oauth) {
          auth.oauth = {};
        }
        _.each(config.oauth, function(value, key) {
          auth.oauth[key] = value;
        });
      }
      accountInfo._setupAuth = auth;
    }


    if (this.actions[action] && this.actions[action].teardown) {
      if (this.getTrackDuplicates()) {
        // confirm teardown and drop any dup tracking from database
        this.actions[action].teardown(channel, accountInfo, function(err) {
          if (err) {
            self.log(err, channel, 'error');
          }
          next(err);
          self._dupTeardown(channel);
        });
      } else {
        this.actions[action].teardown(channel, accountInfo, function(err) {
          if (err) {
            self.log(err, channel, 'error');
          }
          next(err);
        });
      }
    } else {
      if (this.getTrackDuplicates()) {
        self._dupTeardown(channel);
      }
      next(false);
    }
  }
function(action, channel, accountInfo, auth, next) {
    var self = this, config = this.getConfig();

    if (!next && 'function' === typeof auth) {
      next = auth;
    } else {
      if (self.isOAuth()) {
        if (!auth.oauth) {
          auth.oauth = {};
        }
        _.each(config.oauth, function(value, key) {
          auth.oauth[key] = value;
        });
      }
      accountInfo._setupAuth = auth;
    }


    if (this.actions[action] && this.actions[action].teardown) {
      if (this.getTrackDuplicates()) {
        // confirm teardown and drop any dup tracking from database
        this.actions[action].teardown(channel, accountInfo, function(err) {
          if (err) {
            self.log(err, channel, 'error');
          }
          next(err);
          self._dupTeardown(channel);
        });
      } else {
        this.actions[action].teardown(channel, accountInfo, function(err) {
          if (err) {
            self.log(err, channel, 'error');
          }
          next(err);
        });
      }
    } else {
      if (this.getTrackDuplicates()) {
        self._dupTeardown(channel);
      }
      next(false);
    }
  }
function ( action , channel , accountInfo , auth , next ) { var self = this , config = this . getConfig ( ) ; if ( ! next && 'function' === typeof auth ) { next = auth ; } else { if ( self . isOAuth ( ) ) { if ( ! auth . oauth ) { auth . oauth = { } ; } _ . each ( config . oauth , function ( value , key ) { auth . oauth [ key ] = value ; } ) ; } accountInfo . _setupAuth = auth ; } if ( this . actions [ action ] && this . actions [ action ] . teardown ) { if ( this . getTrackDuplicates ( ) ) { // confirm teardown and drop any dup tracking from database this . actions [ action ] . teardown ( channel , accountInfo , function ( err ) { if ( err ) { self . log ( err , channel , 'error' ) ; } next ( err ) ; self . _dupTeardown ( channel ) ; } ) ; } else { this . actions [ action ] . teardown ( channel , accountInfo , function ( err ) { if ( err ) { self . log ( err , channel , 'error' ) ; } next ( err ) ; } ) ; } } else { if ( this . getTrackDuplicates ( ) ) { self . _dupTeardown ( channel ) ; } next ( false ) ; } }
Runs the teardown for a pod action if one exists
Runs the teardown for a pod action if one exists