angular2-node-fb-login icon indicating copy to clipboard operation
angular2-node-fb-login copied to clipboard

Is it possible to avoid next()

Open codemasternode opened this issue 7 years ago • 0 comments

router.route('/auth/facebook')
  .post(passport.authenticate('facebook-token', {session: false}), function(req, res, next) {
    if (!req.user) {
      return res.send(401, 'User Not Authenticated');
    }
    // prepare token for API
    req.auth = {
      id: req.user.id
    };
    next();
  }, generateToken, sendToken);

I mean third argument of method post (function(req,res,next)), and of course render response in this function. And avoid adding fourth and fifth argument (generateToken, sendToken) ?

codemasternode avatar Dec 27 '18 16:12 codemasternode