log ip address of user when logging in

This commit is contained in:
Henry Oswald 2016-11-25 11:27:57 +00:00
parent 65c1a62cb7
commit f130470971

View file

@ -85,7 +85,7 @@ module.exports = AuthenticationController =
UserHandler.setupLoginData(user, ()->) UserHandler.setupLoginData(user, ()->)
LoginRateLimiter.recordSuccessfulLogin(email) LoginRateLimiter.recordSuccessfulLogin(email)
AuthenticationController._recordSuccessfulLogin(user._id) AuthenticationController._recordSuccessfulLogin(user._id)
Analytics.recordEvent(user._id, "user-logged-in") Analytics.recordEvent(user._id, "user-logged-in", {ip:req.ip})
logger.log email: email, user_id: user._id.toString(), "successful log in" logger.log email: email, user_id: user._id.toString(), "successful log in"
req.session.justLoggedIn = true req.session.justLoggedIn = true
# capture the request ip for use when creating the session # capture the request ip for use when creating the session