mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
API: add login username in SendLoginLogCommand (#28544)
* API: add login username in Login actions * LoginUser -> LoginUsername * fix test
This commit is contained in:
parent
96e6524a7d
commit
65b5086a59
@ -181,6 +181,7 @@ func (hs *HTTPServer) LoginPost(c *models.ReqContext, cmd dtos.LoginCommand) Res
|
|||||||
ReqContext: c,
|
ReqContext: c,
|
||||||
LogAction: action,
|
LogAction: action,
|
||||||
User: user,
|
User: user,
|
||||||
|
LoginUsername: cmd.User,
|
||||||
HTTPStatus: response.status,
|
HTTPStatus: response.status,
|
||||||
Error: err,
|
Error: err,
|
||||||
})
|
})
|
||||||
|
@ -687,6 +687,7 @@ func TestLoginPostSendLoginLog(t *testing.T) {
|
|||||||
|
|
||||||
cmd := testReceiver.cmd
|
cmd := testReceiver.cmd
|
||||||
assert.Equal(t, c.cmd.LogAction, cmd.LogAction)
|
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.HTTPStatus, cmd.HTTPStatus)
|
||||||
assert.Equal(t, c.cmd.Error, cmd.Error)
|
assert.Equal(t, c.cmd.Error, cmd.Error)
|
||||||
|
|
||||||
|
@ -70,6 +70,7 @@ type SendLoginLogCommand struct {
|
|||||||
LogAction string
|
LogAction string
|
||||||
User *User
|
User *User
|
||||||
ExternalUser *ExternalUserInfo
|
ExternalUser *ExternalUserInfo
|
||||||
|
LoginUsername string
|
||||||
HTTPStatus int
|
HTTPStatus int
|
||||||
Error error
|
Error error
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user