(err, user, info)
| 45 | }, |
| 46 | login: function(req, res, next) { |
| 47 | function authenticationFailed(err, user, info){ |
| 48 | if (err) { return next(err); } |
| 49 | if (!user) { return res.json(filterUser(user)); } |
| 50 | req.logIn(user, function(err) { |
| 51 | if ( err ) { return next(err); } |
| 52 | return res.json(filterUser(user)); |
| 53 | }); |
| 54 | } |
| 55 | return passport.authenticate(MongoStrategy.name, authenticationFailed)(req, res, next); |
| 56 | }, |
| 57 | logout: function(req, res, next) { |
nothing calls this directly
no test coverage detected