From 62d5eda194acd9177432450ee0cc68dc759d22f0 Mon Sep 17 00:00:00 2001 From: Alexandre Bourdin Date: Wed, 6 Apr 2022 14:34:43 +0200 Subject: [PATCH] Merge pull request #7348 from overleaf/ab-login-events [web] Add events for login buttons clicks and segmentation to user-logged-in event GitOrigin-RevId: 6283feb075e2d16c871d3f4ff54fe903937d3263 --- .../src/Features/Authentication/AuthenticationController.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/web/app/src/Features/Authentication/AuthenticationController.js b/services/web/app/src/Features/Authentication/AuthenticationController.js index 1db3231c54..8587a3d16f 100644 --- a/services/web/app/src/Features/Authentication/AuthenticationController.js +++ b/services/web/app/src/Features/Authentication/AuthenticationController.js @@ -606,7 +606,11 @@ function _loginAsyncHandlers(req, user, anonymousAnalyticsId, isNewUser) { LoginRateLimiter.recordSuccessfulLogin(user.email, () => {}) AuthenticationController._recordSuccessfulLogin(user._id, () => {}) AuthenticationController.ipMatchCheck(req, user) - Analytics.recordEventForUser(user._id, 'user-logged-in') + Analytics.recordEventForUser(user._id, 'user-logged-in', { + source: req.session.saml + ? 'saml' + : req.user_info?.auth_provider || 'email-password', + }) Analytics.identifyUser(user._id, anonymousAnalyticsId, isNewUser) logger.log(