From 6444d5796ebb2fe0a4e3a84cb25e3a094568f625 Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Fri, 20 Sep 2013 15:59:17 +0200 Subject: [PATCH] set wasmodified to true if missing req.query._v --- src/controllers/auth.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/auth.js b/src/controllers/auth.js index 0d569b337c..1269dbec2d 100644 --- a/src/controllers/auth.js +++ b/src/controllers/auth.js @@ -37,7 +37,8 @@ api.auth = function(req, res, next) { if (_.isEmpty(user)) { return res.json(401, NO_USER_FOUND); } - res.locals.wasModified = +user._v !== +req.query._v; + + res.locals.wasModified = (req.query._v ? +user._v !== +req.query._v : true); res.locals.user = user; req.session.userId = user._id; return next();