Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions controllers/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ var Token = require('../models/token');
*/
passport.use(new LocalStrategy(
function(username, password, callback) {
<<<<<<< HEAD

=======
>>>>>>> e5c6f7b8bdcb85f655c2bb074167593700fcd086
User.findOne({ username: username }, function (err, user) {
if (err) { return callback(err); }

Expand All @@ -34,6 +38,7 @@ passport.use(new LocalStrategy(
return callback(null, user);
});
});

}
));

Expand Down
3 changes: 3 additions & 0 deletions models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,8 @@ UserSchema.methods.verifyPassword = function(password, cb) {
});
};




// Export the Mongoose model
module.exports = mongoose.model('User', UserSchema);
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
"log4js": "^0.6.38",
"mongoose": "^4.6.4",
"node-oauth2-server": "^2.4.0",
"node-validator": "^0.1.23",
"oauth2orize": "^1.5.1",
"passport": "^0.3.2",
"passport-http": "^0.3.0",
"passport-http-bearer": "^1.0.1",
"passport-local": "^1.0.0",
"passport-oauth2-client-password": "^0.1.2"
"passport-oauth2-client-password": "^0.1.2",
"validator": "^6.2.1"
}
}
Loading