From 9bf9df9a4a822cdc67cf3f63962adb3f2df74b14 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Thu, 11 Aug 2016 14:09:45 +0100 Subject: [PATCH] Track login events. --- .../Features/Authentication/AuthenticationController.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/web/app/coffee/Features/Authentication/AuthenticationController.coffee b/services/web/app/coffee/Features/Authentication/AuthenticationController.coffee index d75bef5207..4972144737 100644 --- a/services/web/app/coffee/Features/Authentication/AuthenticationController.coffee +++ b/services/web/app/coffee/Features/Authentication/AuthenticationController.coffee @@ -10,6 +10,7 @@ Settings = require "settings-sharelatex" basicAuth = require('basic-auth-connect') UserHandler = require("../User/UserHandler") UserSessionsManager = require("../User/UserSessionsManager") +Analytics = require "../Analytics/AnalyticsManager" module.exports = AuthenticationController = login: (req, res, next = (error) ->) -> @@ -37,6 +38,7 @@ module.exports = AuthenticationController = return next(error) if error? req.session.justLoggedIn = true logger.log email: email, user_id: user._id.toString(), "successful log in" + Analytics.recordEvent user._id, "user-logged-in" res.json redir: redir else AuthenticationController._recordFailedLogin()