Open ohadperry opened 10 years ago
Hi, my service serves more then one app. Meaning he provides login/signup services for more then one clients who has a different db. How do I use the simple local strategy to save to a different db every time??
local
passport.use(new LocalStrategy({ usernameField: 'email' }, function(email, password, done) { User.findOne({ email: email }, function(err, user) { if (!user) return done(null, false, { message: 'Email ' + email + ' not found'}); user.comparePassword(password, function(err, isMatch) { if (isMatch) { return done(null, user); } else { return done(null, false, { message: 'Invalid email or password.' }); } }); }); }));
+1
Do you mind giving a more elaborate example?
Hi, my service serves more then one app. Meaning he provides login/signup services for more then one clients who has a different db. How do I use the simple
local
strategy to save to a different db every time??