Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get two passport objects #27

Closed
zzack opened this issue May 16, 2012 · 2 comments
Closed

How to get two passport objects #27

zzack opened this issue May 16, 2012 · 2 comments

Comments

@zzack
Copy link

zzack commented May 16, 2012

Since passport returns an object (which is shared by any call to require('passport'), how would I go about getting two separate passport objects that can have separate configurations and initializations?

In other words something like:
Passport = require('passport);
pp1 = new Passport()
pp2 = new Passport()

@jaredhanson
Copy link
Owner

The module exports a default singleton, for convenience. The constructor is also exposed, which can be used like so:

var passport = require('passport');

var myPassport = new passport.Passport();
myPassport.use(...);

Each instance has its own set of strategies and configuration.

@Kinnardian
Copy link

You may want to consider using named strategies . . .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants