* API: add login username in Login actions
* LoginUser -> LoginUsername
* fix test
(cherry picked from commit 65b5086a59)
Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
This commit is contained in:
co-authored by
Agnès Toulet
parent
c933d58893
commit
9b3981fb3c
+6
-5
@@ -171,11 +171,12 @@ func (hs *HTTPServer) LoginPost(c *models.ReqContext, cmd dtos.LoginCommand) Res
|
||||
err = errors.New(response.errMessage)
|
||||
}
|
||||
hs.SendLoginLog(&models.SendLoginLogCommand{
|
||||
ReqContext: c,
|
||||
LogAction: action,
|
||||
User: user,
|
||||
HTTPStatus: response.status,
|
||||
Error: err,
|
||||
ReqContext: c,
|
||||
LogAction: action,
|
||||
User: user,
|
||||
LoginUsername: cmd.User,
|
||||
HTTPStatus: response.status,
|
||||
Error: err,
|
||||
})
|
||||
}()
|
||||
|
||||
|
||||
@@ -652,6 +652,7 @@ func TestLoginPostSendLoginLog(t *testing.T) {
|
||||
|
||||
cmd := testReceiver.cmd
|
||||
assert.Equal(t, c.cmd.LogAction, cmd.LogAction)
|
||||
assert.Equal(t, "admin", cmd.LoginUsername)
|
||||
assert.Equal(t, c.cmd.HTTPStatus, cmd.HTTPStatus)
|
||||
assert.Equal(t, c.cmd.Error, cmd.Error)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user