From 1b9027c5e9f42920fca9b55ac9903c8cb5193129 Mon Sep 17 00:00:00 2001 From: JonnyBGod Date: Wed, 8 Aug 2012 20:34:17 +0200 Subject: [PATCH 1/3] Update lib/utils.js for express3 use express3 req.protocol to extract host. Solved error on step getAuthUri --- lib/utils.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/utils.js b/lib/utils.js index 71e922d6..da14194b 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,5 +1,3 @@ -var tls = require('tls'); - var clone = exports.clone = function clone (obj) { if (obj === undefined || obj === null) return obj @@ -25,11 +23,5 @@ function cloneArray (arr) { }; exports.extractHostname = function (req) { - var headers = req.headers - , protocol = (req.connection.server instanceof tls.Server || - req.headers['x-forwarded-proto'].slice(0,5) == 'https') - ? 'https://' - : 'http://' - , host = headers.host; - return protocol + host; + return req.protocol + '://' + req.headers.host; }; From a818e5be1f49697d667395c6843f3b1c885a53d0 Mon Sep 17 00:00:00 2001 From: JonnyBGod Date: Wed, 31 Oct 2012 17:11:38 +0000 Subject: [PATCH 2/3] Update lib/modules/password.js pass req to authenticate step --- lib/modules/password.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules/password.js b/lib/modules/password.js index e64dc1ce..21785542 100644 --- a/lib/modules/password.js +++ b/lib/modules/password.js @@ -162,7 +162,7 @@ everyModule.submodule('password') .accepts('req res next') .promises('login password') .step('authenticate') - .accepts('login password') + .accepts('login password req') .promises('userOrErrors') .step('interpretUserOrErrors') .description('Pipes the output of the step `authenticate` into either the `user` or `errors` param') From c08a56d592d5388eba07ef5cf04f121205765579 Mon Sep 17 00:00:00 2001 From: JonnyBGod Date: Fri, 30 Nov 2012 00:33:34 +0000 Subject: [PATCH 3/3] Update lib/modules/password.js --- lib/modules/password.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/modules/password.js b/lib/modules/password.js index 21785542..13807ce7 100644 --- a/lib/modules/password.js +++ b/lib/modules/password.js @@ -178,7 +178,7 @@ everyModule.submodule('password') .promises(null) .step('respondToLoginSucceed') // TODO Rename to maybeRespondToLoginSucceed ? .description('Execute a HTTP response for a successful login') - .accepts('res user') + .accepts('req res user') .promises(null) .step('respondToLoginFail') .description('Execute a HTTP response for a failed login') @@ -255,7 +255,7 @@ everyModule.submodule('password') .step('getSession') .step('addToSession') .step('respondToRegistrationSucceed') - .accepts('res user') + .accepts('req res user') .promises(null) .extractExtraRegistrationParams( function (req) { return {};