Auth: Make built-in login configurable (#46978)

This commit is contained in:
Alex
2022-10-12 15:34:59 +00:00
committed by GitHub
parent 7d18460d8f
commit 94ed744454
6 changed files with 46 additions and 4 deletions
+5
View File
@@ -220,6 +220,11 @@ func (hs *HTTPServer) LoginPost(c *models.ReqContext) response.Response {
return resp
}
if errors.Is(err, login.ErrNoAuthProvider) {
resp = response.Error(http.StatusInternalServerError, "No authorization providers enabled", err)
return resp
}
// Do not expose disabled status,
// just show incorrect user credentials error (see #17947)
if errors.Is(err, login.ErrUserDisabled) {