Commit 41024c29 by Samuel Committed by Carl Bergquist

Return 404 on user not found (#15606)

Return 404 on user not found

closes #10506
parent 1e719bb3
...@@ -27,6 +27,10 @@ func GetPendingOrgInvites(c *m.ReqContext) Response { ...@@ -27,6 +27,10 @@ func GetPendingOrgInvites(c *m.ReqContext) Response {
} }
func AddOrgInvite(c *m.ReqContext, inviteDto dtos.AddInviteForm) Response { func AddOrgInvite(c *m.ReqContext, inviteDto dtos.AddInviteForm) Response {
if setting.DisableLoginForm {
return Error(400, "Cannot invite when login is disabled.", nil)
}
if !inviteDto.Role.IsValid() { if !inviteDto.Role.IsValid() {
return Error(400, "Invalid role specified", nil) return Error(400, "Invalid role specified", nil)
} }
...@@ -37,10 +41,6 @@ func AddOrgInvite(c *m.ReqContext, inviteDto dtos.AddInviteForm) Response { ...@@ -37,10 +41,6 @@ func AddOrgInvite(c *m.ReqContext, inviteDto dtos.AddInviteForm) Response {
if err != m.ErrUserNotFound { if err != m.ErrUserNotFound {
return Error(500, "Failed to query db for existing user check", err) return Error(500, "Failed to query db for existing user check", err)
} }
if setting.DisableLoginForm {
return Error(401, "User could not be found", nil)
}
} else { } else {
return inviteExistingUserToOrg(c, userQuery.Result, &inviteDto) return inviteExistingUserToOrg(c, userQuery.Result, &inviteDto)
} }
......
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