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
This commit is contained in:
Alexandre Bourdin 2022-04-06 14:34:43 +02:00 committed by Copybot
parent 9cd5922cef
commit 62d5eda194

View file

@ -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(