Merge pull request #5976 from overleaf/jk-login-audit-log-type
[web] Add 'method' info to login audit log GitOrigin-RevId: 093fe885bc1b688aebd640d6762f031c752191d4
This commit is contained in:
@@ -1188,6 +1188,25 @@ describe('AuthenticationController', function () {
|
||||
expect(this.next).to.have.been.calledWith(theError)
|
||||
expect(this.req.login).to.not.have.been.called
|
||||
})
|
||||
|
||||
it('should pass along auditInfo when present', function () {
|
||||
this.AuthenticationController.setAuditInfo(this.req, {
|
||||
method: 'Login',
|
||||
})
|
||||
this.AuthenticationController.finishLogin(
|
||||
this.user,
|
||||
this.req,
|
||||
this.res,
|
||||
this.next
|
||||
)
|
||||
expect(this.UserAuditLogHandler.addEntry).to.have.been.calledWith(
|
||||
this.user._id,
|
||||
'login',
|
||||
this.user._id,
|
||||
'42.42.42.42',
|
||||
{ method: 'Login' }
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('_afterLoginSessionSetup', function () {
|
||||
|
||||
@@ -61,6 +61,7 @@ describe('PasswordResetController', function () {
|
||||
(this.AuthenticationController = {
|
||||
getLoggedInUserId: sinon.stub(),
|
||||
finishLogin: sinon.stub(),
|
||||
setAuditInfo: sinon.stub(),
|
||||
}),
|
||||
'../User/UserGetter': (this.UserGetter = {
|
||||
promises: {
|
||||
|
||||
Reference in New Issue
Block a user