How to use the passport.unuse function in passport

To help you get started, we’ve selected a few passport examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oaeproject / Hilary / node_modules / oae-authentication / lib / api.js View on Github external
_.each(strategies, function(strategy, strategyName) {
        // Get the name we used to register this strategy with passport. This is a combination of the tenant and strategy name
        var passportStrategyName = AuthenticationUtil.getStrategyId(tenant, strategyName);

        // Disable the passport strategy if we registered it previously.
        if (passport._strategy(passportStrategyName)) {
            passport.unuse(passportStrategyName);
        }

        // If the tenant wants the strategy enabled, we enable it. We also create a new instance of the passport strategy so that
        // configuration updates to the strategy are taken into account
        if (strategy.shouldBeEnabled(tenant.alias)) {
            passport.use(passportStrategyName, strategy.getPassportStrategy(tenant));
            log().debug({'tenant': tenant.alias, 'strategy': strategyName, 'passportStrategyName': passportStrategyName}, 'Enabling strategy');
        }
    });
github ReactiveSets / toubkal / lib / server / passport.js View on Github external
_remove_value: function( t, strategy ) {
      var position      = this._a_index_of( strategy )
        , strategy_name = strategy.name
      ;
      
      de&&ug( this._get_name( '_remove_value' ), { strategy_name: strategy_name, position: position } );
      
      if ( position != -1 ) {
        // Unuse passport strategy, using undocumented passport.unuse() source code:
        // https://github.com/jaredhanson/passport/blob/master/lib/authenticator.js#L79
        passport.unuse( strategy_name );
        
        Super._remove_value.call( this, t, get_emitted_strategy( strategy ) );
      } else {
        t.emit_nothing();
      }
    } // _remove_value()
  }; // passport_strategies() prototype
github weseek / growi / src / server / service / passport.js View on Github external
resetSamlStrategy() {
    debug('SamlStrategy: reset');
    passport.unuse('saml');
    this.isSamlStrategySetup = false;
  }
github weseek / growi / src / server / service / passport.js View on Github external
resetGitHubStrategy() {
    debug('GitHubStrategy: reset');
    passport.unuse('github');
    this.isGitHubStrategySetup = false;
  }
github weseek / growi / src / server / service / passport.js View on Github external
resetGoogleStrategy() {
    debug('GoogleStrategy: reset');
    passport.unuse('google');
    this.isGoogleStrategySetup = false;
  }
github weseek / growi / src / server / service / passport.js View on Github external
resetLdapStrategy() {
    debug('LdapStrategy: reset');
    passport.unuse('ldapauth');
    this.isLdapStrategySetup = false;
  }
github kuzzleio / kuzzle / lib / core / auth / passportWrapper.js View on Github external
unuse(name) {
    passport.unuse(name);
    delete this.options[name];
  }
}
github weseek / growi / src / server / service / passport.js View on Github external
resetTwitterStrategy() {
    debug('TwitterStrategy: reset');
    passport.unuse('twitter');
    this.isTwitterStrategySetup = false;
  }
github weseek / growi / src / server / service / passport.js View on Github external
resetLocalStrategy() {
    debug('LocalStrategy: reset');
    passport.unuse('local');
    this.isLocalStrategySetup = false;
  }
github weseek / growi / src / server / service / passport.js View on Github external
resetBasicStrategy() {
    debug('BasicStrategy: reset');
    passport.unuse('basic');
    this.isBasicStrategySetup = false;
  }