Service Accounts: Don't show error pop-ups for Service Account and Renderer UI flows (#101776)

* don't show error pop-ups for SAs and renderer

* only hide non 4xx error pop'ups

* linting
This commit is contained in:
Ieva
2025-03-07 13:37:26 +00:00
committed by GitHub
parent 14ebec527c
commit 392124de00
2 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -505,7 +505,7 @@ func (hs *HTTPServer) ChangeActiveOrgAndRedirectToHome(c *contextmodel.ReqContex
if !c.SignedInUser.IsIdentityType(claims.TypeUser) {
hs.log.Debug("Requested endpoint only available to users")
c.JsonApiErr(http.StatusForbidden, "Endpoint only available for users", nil)
c.JsonApiErr(http.StatusNotModified, "Endpoint only available for users", nil)
return
}
@@ -631,7 +631,7 @@ func (hs *HTTPServer) ClearHelpFlags(c *contextmodel.ReqContext) response.Respon
func (hs *HTTPServer) getUserID(c *contextmodel.ReqContext) (int64, *response.NormalResponse) {
if !c.SignedInUser.IsIdentityType(claims.TypeUser) {
hs.log.Debug("Requested endpoint only available to users")
return 0, response.Error(http.StatusForbidden, "Endpoint only available for users", nil)
return 0, response.Error(http.StatusNotModified, "Endpoint only available for users", nil)
}
userID, err := c.SignedInUser.GetInternalID()