From e659018576c835af2805e305a88eb7c273835f46 Mon Sep 17 00:00:00 2001 From: Ammit Date: Fri, 28 Mar 2014 03:03:04 +0530 Subject: [PATCH] Update returnTo middleware by default express doesn't do case sensitive routing, so `/login` & '/LogIn' are treated same. --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 596278efcc..081b2331b0 100755 --- a/app.js +++ b/app.js @@ -87,7 +87,7 @@ app.use(function(req, res, next) { // Keep track of previous URL if (req.method !== 'GET') return next(); var path = req.path.split('/')[1]; - if (/(auth|login|logout|signup)$/.test(path)) return next(); + if (/(auth|login|logout|signup)$/i.test(path)) return next(); req.session.returnTo = req.path; next(); });