Commit 65b5086a by Agnès Toulet Committed by GitHub

API: add login username in SendLoginLogCommand (#28544)

* API: add login username in Login actions

* LoginUser -> LoginUsername

* fix test
parent 96e6524a
......@@ -181,6 +181,7 @@ func (hs *HTTPServer) LoginPost(c *models.ReqContext, cmd dtos.LoginCommand) Res
ReqContext: c,
LogAction: action,
User: user,
LoginUsername: cmd.User,
HTTPStatus: response.status,
Error: err,
})
......
......@@ -687,6 +687,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)
......
......@@ -70,6 +70,7 @@ type SendLoginLogCommand struct {
LogAction string
User *User
ExternalUser *ExternalUserInfo
LoginUsername string
HTTPStatus int
Error error
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment