shared library for managing external user accounts

This commit is contained in:
Dan Cech
2018-02-08 17:13:58 -05:00
parent 1594ceeb6f
commit 1c5afa731f
23 changed files with 525 additions and 263 deletions

View File

@@ -101,13 +101,13 @@ func LoginPost(c *m.ReqContext, cmd dtos.LoginCommand) Response {
return Error(401, "Login is disabled", nil)
}
authQuery := login.LoginUserQuery{
authQuery := m.LoginUserQuery{
Username: cmd.User,
Password: cmd.Password,
IpAddress: c.Req.RemoteAddr,
}
if err := bus.Dispatch(&authQuery); err != nil {
if err := login.AuthenticateUser(c, &authQuery); err != nil {
if err == login.ErrInvalidCredentials || err == login.ErrTooManyLoginAttempts {
return Error(401, "Invalid username or password", err)
}