From 968f266115fdeb3971689b699add8753433f55a3 Mon Sep 17 00:00:00 2001 From: Michael Salinger Date: Mon, 14 Mar 2016 15:59:18 -0400 Subject: [PATCH 1/2] Removed finally next --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index e177012..e2102c8 100644 --- a/index.js +++ b/index.js @@ -45,11 +45,12 @@ ExpressOAuthServer.prototype.authenticate = function(options) { }) .tap(function(token) { res.locals.oauth = { token: token }; + next(); }) .catch(function(e) { return handleError(e, req, res); - }) - .finally(next); + }); + //.finally(next); }; }; @@ -131,6 +132,7 @@ var handleResponse = function(req, res, response) { */ var handleError = function(e, req, res, response) { + if (response) { res.set(response.headers); } From 9b4ab13c5f73956d0ab0d7eb5f30ccd72aae087b Mon Sep 17 00:00:00 2001 From: Michael Salinger Date: Wed, 9 Nov 2016 06:48:57 -0500 Subject: [PATCH 2/2] Removed additional next calls --- index.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index e2102c8..3eeab63 100644 --- a/index.js +++ b/index.js @@ -50,7 +50,6 @@ ExpressOAuthServer.prototype.authenticate = function(options) { .catch(function(e) { return handleError(e, req, res); }); - //.finally(next); }; }; @@ -81,8 +80,7 @@ ExpressOAuthServer.prototype.authorize = function(options) { }) .catch(function(e) { return handleError(e, req, res, response); - }) - .finally(next); + }); }; }; @@ -113,8 +111,7 @@ ExpressOAuthServer.prototype.token = function(options) { }) .catch(function(e) { return handleError(e, req, res, response); - }) - .finally(next); + }); }; };