diff --git a/services/web/app/coffee/infrastructure/Server.coffee b/services/web/app/coffee/infrastructure/Server.coffee index 9232e6939d..7d551f89b3 100644 --- a/services/web/app/coffee/infrastructure/Server.coffee +++ b/services/web/app/coffee/infrastructure/Server.coffee @@ -109,8 +109,8 @@ passport.deserializeUser(AuthenticationController.deserializeUser) # Measure expiry from last request, not last login webRouter.use (req, res, next) -> req.session.touch() - if req?.session?.user? - UserSessionsManager.touch(req.user, (err)->) + if AuthenticationController.isUserLoggedIn(req) + UserSessionsManager.touch(AuthenticationController.getSessionUser(req), (err)->) next() webRouter.use ReferalConnect.use