SHARE
TWEET
auth
a guest
Dec 12th, 2014
4
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- exports.authenticate = function(app) {
- return function(req, res, next) {
- passport.authenticate('local', function(err, user, info) {
- if (err) { return next(err) }
- if (!user) {
- return res.send(401);
- }
- req.logIn(user, function(err) {
- if (err) { return next(err); }
- return res.send(200);
- });
- })(req, res, next);
- }
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

