mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Track login events.
This commit is contained in:
parent
6a210978fe
commit
9bf9df9a4a
1 changed files with 2 additions and 0 deletions
|
@ -10,6 +10,7 @@ Settings = require "settings-sharelatex"
|
||||||
basicAuth = require('basic-auth-connect')
|
basicAuth = require('basic-auth-connect')
|
||||||
UserHandler = require("../User/UserHandler")
|
UserHandler = require("../User/UserHandler")
|
||||||
UserSessionsManager = require("../User/UserSessionsManager")
|
UserSessionsManager = require("../User/UserSessionsManager")
|
||||||
|
Analytics = require "../Analytics/AnalyticsManager"
|
||||||
|
|
||||||
module.exports = AuthenticationController =
|
module.exports = AuthenticationController =
|
||||||
login: (req, res, next = (error) ->) ->
|
login: (req, res, next = (error) ->) ->
|
||||||
|
@ -37,6 +38,7 @@ module.exports = AuthenticationController =
|
||||||
return next(error) if error?
|
return next(error) if error?
|
||||||
req.session.justLoggedIn = true
|
req.session.justLoggedIn = true
|
||||||
logger.log email: email, user_id: user._id.toString(), "successful log in"
|
logger.log email: email, user_id: user._id.toString(), "successful log in"
|
||||||
|
Analytics.recordEvent user._id, "user-logged-in"
|
||||||
res.json redir: redir
|
res.json redir: redir
|
||||||
else
|
else
|
||||||
AuthenticationController._recordFailedLogin()
|
AuthenticationController._recordFailedLogin()
|
||||||
|
|
Loading…
Reference in a new issue