ErrorHandling: Fixes issues with bad error messages (#63775)

This commit is contained in:
Torkel Ödegaard
2023-03-02 13:09:58 +01:00
committed by GitHub
parent a2bd98488d
commit 27070c252d
5 changed files with 34 additions and 4 deletions
+2 -1
View File
@@ -24,6 +24,7 @@ import (
"github.com/grafana/grafana/pkg/services/secrets"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/util"
"github.com/grafana/grafana/pkg/web"
)
@@ -190,7 +191,7 @@ func (hs *HTTPServer) tryAutoLogin(c *contextmodel.ReqContext) bool {
func (hs *HTTPServer) LoginAPIPing(c *contextmodel.ReqContext) response.Response {
if c.IsSignedIn || c.IsAnonymous {
return response.JSON(http.StatusOK, "Logged in")
return response.JSON(http.StatusOK, util.DynMap{"message": "Logged in"})
}
return response.Error(401, "Unauthorized", nil)