From 1a0e42829a63e39a772882ea0c03dcebfa15abb3 Mon Sep 17 00:00:00 2001 From: Sergey Klimov Date: Thu, 28 Mar 2013 16:43:45 -0700 Subject: [PATCH] special case for user resource (to not conflict with Passport) --- index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index e5fd172..7e2d6de 100644 --- a/index.js +++ b/index.js @@ -86,10 +86,14 @@ Resource.prototype.load = function(fn){ // TODO: ideally we should next() passed the // route handler if (null == obj) return res.send(404); - req[id] = obj; + if (id=="user") { + req["requested"+lingo.capitalize(id)] = obj; + } else { + req[id] = obj; + }; next(); }; - + // Maintain backward compatibility if (2 == fn.length) { fn(req.params[id], callback);