Use multiple local strategies in PassportJS

You can name your local strategies to separate them. // use two LocalStrategies, registered under user and sponsor names // add other strategies for more authentication flexibility passport.use(‘user-local’, new LocalStrategy({ usernameField: ’email’, passwordField: ‘password’ // this is the virtual field on the model }, function(email, password, done) { User.findOne({ email: email }, function(err, user) { … Read more

Advantage of Local Classes Java

Here’s an example of how an anonymous inner class, a local inner class, and a regular inner class might be present in a program. The example is looking at a myMethod method and a InnerClass class present in MyClass class. For the sake of discussion, those classes will all be implementing the Runnable interface: public … Read more