Hi
My node.js skills when it comes to async functions, leaves much to be desired. Below is a copy paste exercise from some code, but I can just not figure out how to return the result from this function call:
function authenticateRequest(req, res, next) {
var request = new Request(req);
var response = new Response(res);
return oauth.authenticate(request, response)
.then(function(token) {
next();
}).catch(function(err) {
msg.res.status(err.code || 500).json(err);
});
}
I know the return inside the function should not be there, that is about all. I would appreciate some assistance.
Regards
Morne