idendify -> identify

This commit is contained in:
Henry Oswald 2017-03-22 16:01:26 +00:00
parent ebdce6169e
commit cff922a0f5
3 changed files with 5 additions and 5 deletions

View file

@ -16,7 +16,7 @@ makeRequest = (opts, callback)->
module.exports = module.exports =
idendifyUser: (user_id, old_user_id, callback = (error)->)-> identifyUser: (user_id, old_user_id, callback = (error)->)->
opts = opts =
body: body:
old_user_id:old_user_id old_user_id:old_user_id

View file

@ -87,7 +87,7 @@ module.exports = AuthenticationController =
LoginRateLimiter.recordSuccessfulLogin(email) LoginRateLimiter.recordSuccessfulLogin(email)
AuthenticationController._recordSuccessfulLogin(user._id) AuthenticationController._recordSuccessfulLogin(user._id)
Analytics.recordEvent(user._id, "user-logged-in", {ip:req.ip}) Analytics.recordEvent(user._id, "user-logged-in", {ip:req.ip})
Analytics.idendifyUser(user._id, req.sessionID) Analytics.identifyUser(user._id, req.sessionID)
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

View file

@ -255,7 +255,7 @@ describe "AuthenticationController", ->
@LoginRateLimiter.processLoginRequest.callsArgWith(1, null, true) @LoginRateLimiter.processLoginRequest.callsArgWith(1, null, true)
@AuthenticationManager.authenticate = sinon.stub().callsArgWith(2, null, @user) @AuthenticationManager.authenticate = sinon.stub().callsArgWith(2, null, @user)
@req.sessionID = Math.random() @req.sessionID = Math.random()
@AnalyticsManager.idendifyUser = sinon.stub() @AnalyticsManager.identifyUser = sinon.stub()
@AuthenticationController.doPassportLogin(@req, @req.body.email, @req.body.password, @cb) @AuthenticationController.doPassportLogin(@req, @req.body.email, @req.body.password, @cb)
it "should attempt to authorise the user", -> it "should attempt to authorise the user", ->
@ -263,8 +263,8 @@ describe "AuthenticationController", ->
.calledWith(email: @email.toLowerCase(), @password) .calledWith(email: @email.toLowerCase(), @password)
.should.equal true .should.equal true
it "should call idendifyUser", -> it "should call identifyUser", ->
@AnalyticsManager.idendifyUser.calledWith(@user._id, @req.sessionID).should.equal true @AnalyticsManager.identifyUser.calledWith(@user._id, @req.sessionID).should.equal true
it "should setup the user data in the background", -> it "should setup the user data in the background", ->
@UserHandler.setupLoginData.calledWith(@user).should.equal true @UserHandler.setupLoginData.calledWith(@user).should.equal true